Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Einsatz eigener Extbase Controller Views
Vortrag zum Meetup der TYPO3 User Group Dresden
move:elevator
January 17, 2017
More Decks by move:elevator
See All by move:elevator
Event Sourcing
moveelevator
0
120
Agile Organisation
moveelevator
0
840
Middleware in TYPO3
moveelevator
0
720
PWA in Practice
moveelevator
0
130
Extbase: Alternativen zu "findAll"
moveelevator
0
460
Structured Data mit TYPO3
moveelevator
0
98
So geht Employer Branding
moveelevator
0
490
Kundenportale mit TYPO3
moveelevator
0
160
React Native Web
moveelevator
1
140
Other Decks in Programming
See All in Programming
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
210
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
180
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.2k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
120
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
160
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
Modding RubyKaigi for Myself
yui_knk
0
910
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
250
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
3
1.3k
Featured
See All Featured
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
770
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
160
The Spectacular Lies of Maps
axbom
PRO
1
800
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
250
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