typo3camp 2009 - einführung in fluid
Post on 03-Sep-2014
8.862 views
Embed Size (px)
DESCRIPTION
Einführung in Fluid - der Templating Engine für TYPO3 4.3.TRANSCRIPT
- Einfhrung in Fluid Templating made easy 10. Oktober 2009 - TYPO3camp Mnchen Patrick Lobacher Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 1
- Was ist Fluid? Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 2
- Was ist Fluid? Moderne und erweiterbare Templating-Engine fr Frontend und Backend (Entwickelt von Sebastian Kurfrst) Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 3
- Templating-Engine Daten Template Templating-Engine Ausgabe Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 4
- Templating-Bereiche in TYPO3 Seiten-Templates Frontend-Plugins Backend-Module Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 5
- Templating-Bereiche in TYPO3 Seiten-Templates (Marker/Subpart) Frontend-Plugins (Fluid) Backend-Module (Fluid) Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 6
- Warum eine neue Templating-Engine? Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 7
- Template-Code in pi1 // Template ermitteln $this->templateCode = $this->cObj->leResource($conf['templateFile']); // Subpart auslesen $template['total'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE###'); // Marker fllen $markerArray['###MARKER1###'] = 'content for marker 1'; $markerArray['###MARKER2###'] = 'content for marker 2'; // Marker im Template ersetzen $content = $this->cObj->substituteMarkerArrayCached($template['total'],$markerArray); Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 8
- Nachteile der Marker-Methode Layout und Code wird vermischt Designer und Programmierer knnen nicht unabhngig voneinander arbeiten schlecht erweiterbar (neue Marker) komplizierte API-Funktionen keine Kontrollstrukturen Nur Strings und Arrays -> keine Objekte mglich Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 9
- Ziel von Fluid Einfache und elegante Template-Engine Untersttzung des Template-Autors (Autovervollstndigung in Eclipse, ...) Einfache Erweiterbarkeit Intuitive Verwendung Verschiedene Ausgabeformate sollen mglich sein vollstndige Objektorientierung Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 10
- Mitmachen!! Extension: efempty Nur ein Model + Controller + View TYPO3 4.3 (alpha/beta) Extbase und Fluid Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 11
- Extension: efempty 1 - Zuweisung (PHP) 2 - Template (HTML) Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 12
- Fluid: Aufbau Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 13
- Fluid Eigene ViewHelper Core-ViewHelper Basis-Syntax Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 14
- Fluid: Basis Syntax Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 15
- Variablen (Strings) Zuweisung $this->view->assign('helloworld1', 'Hello World 1!'); Template
{helloworld1}
AusgabeHello World 1!
Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 16 - Arrays (numerisch) Zuweisung $array = array('Hello', 'World', '2!'); $this->view->assign('helloworld2', $array); Template
{helloworld2.0} {helloworld2.1} {helloworld2.2}
AusgabeHello World 2!
Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 17 - Arrays (assoziativ) Zuweisung $array = array('rst' => 'Hello', 'middle' => 'World', 'last' => '3!'); $this->view->assign('helloworld3', $array); Template
{helloworld3.rst} {helloworld3.middle} {helloworld3.last}
AusgabeHello World 3!
Inspiring people to Einfhrung in Fluid share Sonntag, 11. Oktober 2009 18 - Objekte Zuweisung $start = new Tx_Efempty_Domain_Model_Start; $start->setTitle("Hello World 4!"); $th