Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Einsatz eigener Extbase Controller Views
Search
move:elevator
January 17, 2017
Programming
0
300
Einsatz eigener Extbase Controller Views
Vortrag zum Meetup der TYPO3 User Group Dresden
move:elevator
January 17, 2017
Tweet
Share
More Decks by move:elevator
See All by move:elevator
Event Sourcing
moveelevator
0
100
Agile Organisation
moveelevator
0
780
Middleware in TYPO3
moveelevator
0
670
PWA in Practice
moveelevator
0
110
Extbase: Alternativen zu "findAll"
moveelevator
0
410
Structured Data mit TYPO3
moveelevator
0
83
So geht Employer Branding
moveelevator
0
440
Kundenportale mit TYPO3
moveelevator
0
130
React Native Web
moveelevator
1
110
Other Decks in Programming
See All in Programming
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
110
[SF Ruby Conf 2025] Rails X
palkan
0
430
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
360
AIコーディングエージェント(Manus)
kondai24
0
110
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
310
モデル駆動設計をやってみよう Modeling Forum2025ワークショップ/Let’s Try Model-Driven Design
haru860
0
230
エディターってAIで操作できるんだぜ
kis9a
0
640
sbt 2
xuwei_k
0
180
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
18k
CSC509 Lecture 14
javiergs
PRO
0
220
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
2
1k
TypeScriptで設計する 堅牢さとUXを両立した非同期ワークフローの実現
moeka__c
6
2.9k
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Raft: Consensus for Rubyists
vanstee
140
7.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Building Adaptive Systems
keathley
44
2.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
Practical Orchestrator
shlominoach
190
11k
Transcript
GROUP
Eigene Extbase Controller Views
Jan Männig, Team Lead CMS-Development move:elevator
1. MVC-Pattern 2. Status Quo 3. Fluid Standard View 4.
Beispiel 5. Weiterführende Informationen Agenda
MVC-Pattern
MVC-Pattern VIEW CONTROLLER MODEL
Status Quo
„Controller, die eierlegende Wollmilchsau“
Status Quo - Auslagerung der Logik in Controller oder in
vom Controller ausgehende Objekte - meistens Abbruch durch die() oder exit
„Schuster, bleib bei deinem Leisten.“
Der View …
FluidTemplateView /** * @package JanMaennig\ExtbaseViewExample\Controller */ class RecordController extends ActionController
{ public function listAction() { $records = $this->recordRepository->findAll(); $this->view->assign('records', $records); } /** * @param \JanMaennig\ExtbaseViewExample\Domain\Model\Record $record */ public function singleAction(Record $record) { $this->view->assign('record', $record); } } Controller (Auszug)
FluidTemplateView <div class="container"> <div class="row"> <div class="col-xs-11"> <h1> {record.title} </h1>
</div> <div class="cols-xc-1"> <f:link.action action="single" controller="RecordPdf" arguments="{record: '{record}'}" additionalParams="{type:1234}"> <span class="glyphicon glyphicon-download"></span> </f:link.action> </div> </div> <div class="row"> <div class="col-xs-12"> <f:image src="{record.images.0.uid}" Template (Auszug)
FluidTemplateView
„Selbst ist der Developer“
Vorab etwas TypoScript
Nutzung eigener Views pdfView = PAGE pdfView { typeNum =
1234 config { admPanel = 0 debug = 0 } 10 < tt_content.list.20.extbaseviewexample_examplerecords } Einbindung des Plugins in eigenen Pagetype
Beispiel
Beispiel PDF-Druck der Detailansicht <?php namespace JanMaennig\ExtbaseViewExample\Controller; use
JanMaennig\ExtbaseViewExample\View\PdfView; /** * @package JanMaennig\ExtbaseViewExample\Controller */ class RecordPdfController extends RecordController { protected $defaultViewObjectName = PdfView::class; } PdfController, zur Änderung des „DefaultViewObjects“
Beispiel PDF-Druck der Detailansicht <?php namespace JanMaennig\ExtbaseViewExample\View; use
TYPO3\CMS\Fluid\View\TemplateView; class PdfView extends TemplateView { /** * @return void */ public function render() { header("Content-type:application/pdf"); $content = parent::render(); $mpdf = new \mPDF(); $mpdf->WriteHTML($content); $mpdf->Output('test.pdf', 'D'); return; } } PdfView abgeleitet vom TemplateView
PDF
Weiterführende Informationen
Weiterführende Informationen Vorteile - Klare Trennung zwischen Ausgabelogik und Controller
- kein „exit“ oder anderweitiger Abbruch der Logik im Controller notwendig - Einhaltung des Slim Controller Prinzips Nachteile - Weiterer Controller notwendig - zum Teil TypoScript (Pagetype) notwendig
Nutzungsmöglichkeiten - PDF-Download - Excel-Export - Verwendung anderer Template-Engines -
Bereitstellung von APIs - AJAX-Calls Weiterführende Informationen
Weitere Links - https://usetypo3.com/json-view.html - https://github.com/janmaennig/extbase-view-example/ Weitere Informationen
Vielen Dank!
Quellen Bilder / Fotos