TYPO3 Extbase, 3rd Edition (English)
TYPO3 Extbase, 3rd Edition (English)
Modern Extension Development for TYPO3 CMS with Extbase and Fluid
About the Book
Extensions play a central role in the development of complex TYPO3 CMS installations. To build effective solutions, every TYPO3 developer needs to know specific programming techniques. Today, the Extbase Framework and the Fluid Templating Engine are regarded as the standard.
This technical book is suited for both beginners and seasoned TYPO3 developers and provides all you need to know to plan and implement projects of any size with Extbase and Fluid. From the basics of object-oriented programming in PHP to the principles of domain-driven design (DDD) and the model-view-controller concept (MVC), the book explains theoretical foundations as well as practical solutions in an easily understandable way. An easy to follow introduction to the basics is followed by a step-by-step guide to developing real-world, complex scenarios using best practices. A dedicated chapter provides details on coding and security standards in TYPO3 and on how to add measures of security and avoid typical vulnerabilities when building extensions.
Gain insight to this advanced topic and learn how to write clean code that complies to modern standards and programming principles for TYPO3 v9 LTS and newer.
Table of Contents
-
Preface
- Patrick’s Background
- Michael’s Background
- Acknowledgements
- Piracy
-
1. The History of Extbase and Fluid
- 1.1 The Origin of TYPO3
- 1.2 Berlin Manifesto
- 1.3 New PHP Framework
- 1.4 The Death of the Phoenix
- 1.5 The Split
- 1.6 Extbase and Fluid
-
2. PHP Programming Basics
- 2.1 Object-Oriented Programming
- 2.2 Classes and Objects
-
2.3 Methods
- 2.3.1 The Arrow Operator
- 2.3.2 The Constructor
-
2.3.3 Access by Using
$this
- 2.3.4 Filling Methods with Content
-
2.4 Inheritance of Classes
-
2.4.1 Access by Using
parent
- 2.4.2 Verifying Class Derivation
-
2.4.1 Access by Using
- 2.5 Abstract Classes
- 2.6 Interfaces
-
2.7 Visibility: Public and Protected
- 2.7.1 Getter and Setter
- 2.8 Type Hints
- 2.9 Return Type Declarations
- 2.10 Strict Types
- 2.11 Static Calls
- 2.12 Namespaces
-
2.13 Important Design Patterns
- 2.13.1 Singleton
- 2.13.2 Prototype
- 2.13.3 Dependency Injection
- 2.14 Annotations
-
2.15 Coding Standards
- 2.15.1 PSR-1
- 2.15.2 PSR-2
- 2.15.3 Code Comments
-
3. Domain-driven Design
- 3.1 Infrastructure Ignorance
- 3.2 Vertical-Layered Architecture
-
3.3 The Domain Model
- 3.3.1 Ubiquitous Language
- 3.3.2 Building Blocks of DDD
-
3.4 Structuring DDD
- 3.4.1 Bounded Context
- 3.4.2 Context Map
- 3.4.3 Core Domain
- 3.4.4 Shared Kernel
- 3.5 Recap
-
4. Preparation
- 4.1 TYPO3 Pre-installed
-
4.2 Setting Up TYPO3
- 4.2.1 System Requirements
- 4.2.2 Installation Using PHP Composer
- 4.2.3 Site Package
- 4.2.4 Development Application Context
-
4.3 Extension Fundamentals
- 4.3.1 Extension Keys
- 4.3.2 TYPO3 Extension Repository
- 4.3.3 TER Extensions and Composer
- 4.3.4 Further Publishing Methods
- 4.3.5 Extensions, Plugins, Modules, and Distributions
- 4.3.6 Behind the Scenes
- 4.3.7 File and Directory Structure
- 4.4 Development Environment
- 4.5 Recap
-
5. Create a Domain Model
- 5.1 Domain Model Used in this Book
-
5.2 Basic Concept
- 5.2.1 The Glossary
- 5.2.2 Domain Model
-
5.3 The TYPO3 Extension Builder
- 5.3.1 History
- 5.3.2 How the Extension Builder Works
- 5.3.3 Target Audience
- 5.3.4 Limitations
- 5.3.5 Installation
- 5.3.6 Extension Properties
- 5.3.7 Domain Model
- 5.3.8 Domain Model Properties
- 5.3.9 Domain Model Relations
- 5.4 Extension Activation
- 5.5 Autoloading PHP Classes
- 5.6 Recap
-
6. Analysing Initial Files
-
6.1 Files Created by the Extension Builder
-
6.1.1 Files in the Folder
Classes/
-
6.1.2 Files in the Folder
Configuration/
-
6.1.3 Files in the Folder
Resources/
-
6.1.4 Files in the Folder
Tests/
- 6.1.5 Files in the Root Directory
-
6.1.1 Files in the Folder
-
6.2 Additional Functionality of the Extension Builder
- 6.2.1 Modifying the Model
-
6.3 TypoScript
constants
andsetup
- 6.4 Recap
-
6.1 Files Created by the Extension Builder
-
7. The CRUD Process
- 7.1 Model-View-Controller in Extbase
-
7.2 Creating an Object
- 7.2.1 Create Action in Controller
-
7.2.2 Creating the Template for the
listAction()
- 7.2.3 Side Note: Template Rendering
- 7.2.4 Create Static Blogs
- 7.2.5 Persisting Blogs
- 7.2.6 How Persistence Works
- 7.2.7 The PersistenceManager: Manual Persistence
- 7.2.8 Create Your Own Action
- 7.2.9 Form to Create an Object
- 7.3 Reading an Object
- 7.4 Updating an Object
-
7.5 Deleting an Object
- 7.5.1 Exercise
-
7.6 Fine-tuning of the Visual Appearance
- 7.6.1 “Font Awesome” Icons
- 7.6.2 List View: Align Buttons Right
- 7.6.3 Button Margins
- 7.7 Recap
-
8. Fluid Templating
- 8.1 Templates, Layouts and Partials
-
8.2 Using an Overall Layout
- 8.2.1 Multiple Sections
- 8.2.2 Optional Sections
-
8.3 Partials
- 8.3.1 Simple Partials
- 8.3.2 Complex Partials
- 8.4 Recap
-
9. Query Manager and Repositories
- 9.1 Repository Class
- 9.2 Magic Functions
-
9.3 Default Structure of a Query
- 9.3.1 Side Note: Debugging
-
9.4 Adjusting Queries
- 9.4.1 Determine Result Set
- 9.4.2 Limiting Result Set
- 9.4.3 Logical Conjunction
- 9.4.4 Native SQL
- 9.4.5 Query Settings
- 9.5 Example: Search for Keyword in Title
- 9.6 Dynamic Search in the Repository
- 9.7 Side Note: Request Object
- 9.8 Recap
-
10. TypoScript and FlexForm Configuration
-
10.1 TypoScript
- 10.1.1 Setup Scope
- 10.1.2 Sub-keys
-
10.1.3 Option:
view
-
10.1.4 Option:
persistence
-
10.1.5 Option:
objects
-
10.1.6 Option:
features
-
10.1.7 Option:
mvc
-
10.1.8 Option:
settings
-
10.1.9 Option:
_LOCAL_LANG
-
10.1.10 Option:
_CSS_DEFAULT_STYLE
-
10.2 FlexForms
- 10.2.1 FlexForm Configuration
- 10.2.2 Accessing the FlexForm Configuration
- 10.2.3 Accessing Settings Outside of a Controller
- 10.2.4 Switchable Controller Actions (SCA)
- 10.3 TypoScript for Backend Modules
- 10.4 Adjustments for the Next Chapters
- 10.5 Recap
-
10.1 TypoScript
-
11. Validation and Error Handling
- 11.1 Point where Validation Happens
-
11.2 Displaying Errors
- 11.2.1 ViewHelper: Validation Results
- 11.3 Validation Overview
-
11.4 Property Validation
- 11.4.1 Built-in Validators
- 11.4.2 Multiple Validators
- 11.4.3 Custom Validators
- 11.5 Object Validation
- 11.6 Action Validation
- 11.7 Explicitly Ignore Validation
-
11.8 Flash Messages
- 11.8.1 Generating Flash Messages
- 11.8.2 Displaying Flash Messages
- 11.8.3 Flash Message Queues
- 11.8.4 The Flash Message Queue in a Controller
- 11.8.5 Practice Option
- 11.9 Recap
-
12. ViewHelpers
-
12.1 ViewHelpers in General
- 12.1.1 Namespace
- 12.1.2 PHP Class Files
- 12.2 ViewHelpers in the TYPO3 Core
- 12.3 ViewHelpers by the Community
-
12.4 Custom ViewHelpers
- 12.4.1 Text-ViewHelper
- 12.4.2 TagBased-ViewHelper
- 12.4.3 Condition-ViewHelper
- 12.4.4 Widget-ViewHelper
-
12.5 Test Your Knowledge
- 12.5.1 Exercise: The Gravatar ViewHelper
- 12.5.2 Exercise: The A-to-Z Widget
-
12.6 Methods
renderStatic()
andrender()
- 12.7 Recap
-
12.1 ViewHelpers in General
-
13. Relations
- 13.1 Relation in Domain Model
-
13.2 The Table Configuration Array (TCA)
-
13.2.1 TCA:
ctrl
-
13.2.2 TCA:
interface
-
13.2.3 TCA:
types
-
13.2.4 TCA:
palettes
-
13.2.5 TCA:
columns
-
13.2.1 TCA:
-
13.3 The CRUD Process of Posts
- 13.3.1 Preparation
- 13.3.2 Create Posts
- 13.3.3 Read Posts
- 13.3.4 Update Posts
- 13.3.5 Delete Posts
-
13.4
m:n
-Relations (Tags)- 13.4.1 Creation of Tags in the Backend
- 13.4.2 Repository for Tags
-
13.4.3 Read Tags in the
Post
Controller - 13.4.4 Templates and Partials Adjustments
- 13.4.5 Show Tags in List of Posts
-
13.5
1:1
-Relations (Authors)- 13.5.1 Frontend Users and Groups
-
13.5.2 Map
Author
tofe_users
- 13.5.3 Implementing the Frontend Part
- 13.5.4 Auto-Assign Frontend User
- 13.5.5 Obfuscate Email Addresses
-
13.6 Comments as AJAX Requests
- 13.6.1 Controller and Action
- 13.6.2 Ajax Controller
- 13.6.3 Display of Comments
- 13.6.4 JavaScript
- 13.6.5 AJAX Page Type in TypoScript
- 13.7 Recap
-
14. Labels and Localization
- 14.1 Why Use Language Files?
-
14.2 Language Files
- 14.2.1 Placeholders
- 14.2.2 Variables
- 14.2.3 Update all Template Files
- 14.3 Overwrite Labels in TypoScript
-
14.4 Language Configuration
- 14.4.1 Website Language
- 14.4.2 Site Configuration
- 14.4.3 Page Translation
- 14.4.4 Content Element Translation
-
14.5 Localized Language File
- 14.5.1 Overwrite Labels in TypoScript
- 14.6 Language Labels in PHP
-
14.7 Domain Object Localization
- 14.7.1 The Table Configuration Array (TCA)
- 14.7.2 Translate Records
- 14.8 Recap
-
15. Property Mapper and Type Converter
-
15.1 Property Mapper
- 15.1.1 Type Converter
- 15.1.2 Property Mapper Configuration
-
15.2 File Upload Functionality
- 15.2.1 Security Aspects
- 15.2.2 Blog Controller
- 15.2.3 Upload FileReference Converter
- 15.2.4 Blog Domain Model
- 15.2.5 TCA of the Blog Domain Model
-
15.2.6
FileReference
Domain Model - 15.2.7 TypoScript
- 15.2.8 Partials and Templates
- 15.2.9 FormUpload-ViewHelper
- 15.3 File Upload Test
- 15.4 Recap
-
15.1 Property Mapper
-
16. Backend Module
- 16.1 Requirements and Solution Design
-
16.2 Basic Components
- 16.2.1 Module Registration
- 16.2.2 Language File
- 16.2.3 Abstract Backend Controller
-
16.3 First Function: List Comments
- 16.3.1 Comment Controller
- 16.3.2 Fluid Templates
-
16.4 Second Function: Dashboard
- 16.4.1 Extend Module Registration
- 16.4.2 Extend Action Menu
- 16.4.3 Dashboard Controller
- 16.4.4 Fluid Templates
- 16.4.5 Visualise Statistical Data
- 16.4.6 RequireJS
- 16.4.7 AJAX in the TYPO3 Backend
- 16.4.8 Add AJAX Functionality to JavaScript
- 16.4.9 Fine-tuning and Additional Notes
-
16.5 Styleguide Extension
- 16.5.1 Installation
- 16.5.2 Usage
- 16.6 Recap
-
17. Clean-up and Finalisation
- 17.1 Annotations
- 17.2 PSR-2 Coding Standard (“PHP CodeSniffer”)
- 17.3 DocBlocks (“phpDocumentor”)
- 17.4 Documentation
- 17.5 Recap
-
18. Security Basics
- 18.1 TYPO3 Security Team
- 18.2 Security in TYPO3 Extensions
-
18.3 Most Common Security Vulnerabilities
- 18.3.1 OWASP Top 10
- 18.3.2 Injection Flaws
- 18.3.3 Cross-site Scripting
- 18.3.4 Cross-Site Request Forgery
- 18.3.5 Lack of Access Control
- 18.4 Further Typical Security Vulnerabilities
-
19. What’s Next
- 19.1 Get Officially Certified
-
Appendix
- TYPO3 Release History
- Extension Declaration File
-
References and Further Reading
- Unofficial Websites
- PHP Security
- Glossary
- Changelog
- Notes
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned$12,307,240writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Personal Finance
Jason AndersonThis textbook provides an in-depth analysis on personal finance that is both practical and straightforward in its approach. It has been written in such a way that the readers can gain knowledge without getting overwhelmed by the technical terms. Suitable for both beginners and advanced learners.
Getting to Know IntelliJ IDEA
Trisha Gee and Helen ScottIf we treat our IDE as a text editor, we are doing ourselves a disservice. Using a combination of tutorials and a questions-and-answers approach, Getting to Know IntelliJ IDEA will help you find ways to use IntelliJ IDEA that enable you to work comfortably and productively as a professional developer.
C++20 - The Complete Guide
Nicolai M. JosuttisAll new language and library features of C++20 (for those who know previous C++ versions).
The book presents all new language and library features of C++20. Learn how this impacts day-to-day programming, to benefit in practice, to combine new features, and to avoid all new traps.
Buy early, pay less, free updates.
Other books:
Mastering STM32 - Second Edition
Carmine NovielloWith more than 1200 microcontrollers, STM32 is probably the most complete ARM Cortex-M platform on the market. This book aims to be the most complete guide around introducing the reader to this exciting MCU portfolio from ST Microelectronics and its official CubeHAL and STM32CubeIDE development environment.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Machine Learning Q and AI
Sebastian Raschka, PhDHave you recently completed a machine learning or deep learning course and wondered what to learn next? With 30 questions and answers on key concepts in machine learning and AI, this book provides bite-sized bits of knowledge for your journey to becoming a machine learning expert.
Stats One
William FooteThe Rails 7 Way
Obie Fernandez, Lucas Dohmen, and Tom Henrik AadlandThe Rails™ 7 Way is the comprehensive, authoritative reference guide for professionals delivering production-quality code using modern Ruby on Rails. It illuminates the entire Rails 7 API, its most powerful idioms, design approaches, and libraries. Building on the previous editions, this edition has been heavily refactored and updated.
Gradual Modularization for Ruby and Rails
Stephan HagemannGet yourself a new tool to manage your Rails application and your growing engineering organization! Prevent the ball-of-mud (and fix it!). Go for microservices or SOA if it makes sense not just because you don't have any other tool. Do all this through a low-overhead tool: packages. Enable better conversations to make practical changes today.
Top Bundles
- #1
Software Architecture
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #3
1500 QUIZ COMMENTATI (3 libri)
3 Books
Tre libri dei QUIZ MMG Commentati al prezzo di DUE! I QUIZ dei concorsi ufficiali di Medicina Generale relativi agli anni: 2000-2001-2003-2012-2013-2014-2015-2016-2017-2018-2019-2020-2021 +100 inediti Raccolti in unico bundle per aiutarvi nello studio e nella preparazione al concorso. All'interno di ogni libro i quiz sono stati suddivisi per... - #4
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #5
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #6
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also... - #7
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #9
Development and Deployment of Multiplayer Online Games, Part ARCH. Architecture (Vol. I-III)
3 Books
What's the Big Idea? The idea behind this book is to summarize the body of knowledge that already exists on multiplayer games but is not available in one single place.And quite a fewof the issues discussed within this series (planned as three nine volumes ~300 pages each), while known in the industry, have not been published at all (except for... - #10
Growing Agile: The Complete Coach's Guide
7 Books
Growing Agile: Coach's Guide Series This bundle provides a collection of training and workshop plans for a variety of agile topics. The series is aimed at agile coaches, trainers and ScrumMasters who often find themselves needing to help teams understand agile concepts. Each book in the series provides the plans, slides, handouts and activity...