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
0
310
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
110
Agile Organisation
moveelevator
0
820
Middleware in TYPO3
moveelevator
0
700
PWA in Practice
moveelevator
0
120
Extbase: Alternativen zu "findAll"
moveelevator
0
440
Structured Data mit TYPO3
moveelevator
0
94
So geht Employer Branding
moveelevator
0
470
Kundenportale mit TYPO3
moveelevator
0
160
React Native Web
moveelevator
1
130
Other Decks in Programming
See All in Programming
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
630
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
630
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
340
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
300
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
How to stabilize UI tests using XCTest
akkeylab
0
140
Rethinking API Platform Filters
vinceamstoutz
0
980
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
1.4k
飯MCP
yusukebe
0
390
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
170
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
200
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
420
A Modern Web Designer's Workflow
chriscoyier
698
190k
Tell your own story through comics
letsgokoyo
1
870
Game over? The fight for quality and originality in the time of robots
wayneb77
1
150
Skip the Path - Find Your Career Trail
mkilby
1
89
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
870
Technical Leadership for Architectural Decision Making
baasie
3
300
Exploring anti-patterns in Rails
aemeredith
2
290
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