Leanpub Header

Skip to main content

TYPO3 Extbase, 3rd Edition (English)

Modern Extension Development for TYPO3 CMS with Extbase and Fluid

Learn how to develop modern TYPO3 extensions with Extbase and Fluid!

The reworked and restructured 3rd edition of the book is based on TYPO3 v9 LTS and takes all modern practices and new aspects of this latest stable LTS release into account.

https://www.extbase-book.org

Minimum price

$19.99

$24.99

You pay

$24.99

Author earns

$19.99
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
328
Readers
418
Pages
About

About

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.

Author

About the Author

Michael Schams

Michael Schams is a well-known, long-term member of the TYPO3 community with many years of professional experience. He holds a master's degree in computer sciences, is an international advocate of open-source software, and a regular writer for technical journals and online media.

Currently based in Melbourne (Australia), Michael consults with clients across the globe to achieve best outcomes in the digital space. He is a member of the TYPO3 Education Committee and an AWS certified Cloud Practitioner and an AWS certified Solutions Architect.

? https://schams.net

Contents

Table of Contents

Preface

  1. Bookmark this web address
  2. Patrick’s Background
  3. Michael’s Background
  4. Acknowledgements
  5. Piracy

1.The History of Extbase and Fluid

  1. 1.1The Origin of TYPO3
  2. 1.2Berlin Manifesto
  3. 1.3New PHP Framework
  4. 1.4The Death of the Phoenix
  5. 1.5The Split
  6. 1.6Extbase and Fluid

2.PHP Programming Basics

  1. 2.1Object-Oriented Programming
  2. OOP in Extbase and Fluid
  3. 2.2Classes and Objects
  4. Syntax
  5. 2.3Methods
  6. 2.3.1The Arrow Operator
  7. 2.3.2The Constructor
  8. 2.3.3Access by Using $this
  9. 2.3.4Filling Methods with Content
  10. 2.4Inheritance of Classes
  11. 2.4.1Access by Using parent
  12. 2.4.2Verifying Class Derivation
  13. 2.5Abstract Classes
  14. 2.6Interfaces
  15. 2.7Visibility: Public and Protected
  16. Visibility in Extbase and Fluid
  17. 2.7.1Getter and Setter
  18. 2.8Type Hints
  19. 2.9Return Type Declarations
  20. 2.10Strict Types
  21. 2.11Static Calls
  22. 2.12Namespaces
  23. 2.13Important Design Patterns
  24. 2.13.1Singleton
  25. 2.13.2Prototype
  26. 2.13.3Dependency Injection
  27. 2.14Annotations
  28. 2.15Coding Standards
  29. PSR and PHP FIG
  30. 2.15.1PSR-1
  31. 2.15.2PSR-2
  32. 2.15.3Code Comments

3.Domain-driven Design

  1. 3.1Infrastructure Ignorance
  2. 3.2Vertical-Layered Architecture
  3. 3.3The Domain Model
  4. 3.3.1Ubiquitous Language
  5. Pragmatic Approach
  6. 3.3.2Building Blocks of DDD
  7. 3.4Structuring DDD
  8. 3.4.1Bounded Context
  9. 3.4.2Context Map
  10. 3.4.3Core Domain
  11. 3.4.4Shared Kernel
  12. 3.5Recap

4.Preparation

  1. 4.1TYPO3 Pre-installed
  2. 4.2Setting Up TYPO3
  3. TYPO3 v10 and higher
  4. 4.2.1System Requirements
  5. 4.2.2Installation Using PHP Composer
  6. 4.2.3Site Package
  7. 4.2.4Development Application Context
  8. 4.3Extension Fundamentals
  9. 4.3.1Extension Keys
  10. 4.3.2TYPO3 Extension Repository
  11. 4.3.3TER Extensions and Composer
  12. 4.3.4Further Publishing Methods
  13. 4.3.5Extensions, Plugins, Modules, and Distributions
  14. 4.3.6Behind the Scenes
  15. 4.3.7File and Directory Structure
  16. 4.4Development Environment
  17. 4.5Recap

5.Create a Domain Model

  1. 5.1Domain Model Used in this Book
  2. 5.2Basic Concept
  3. 5.2.1The Glossary
  4. 5.2.2Domain Model
  5. 5.3The TYPO3 Extension Builder
  6. 5.3.1History
  7. 5.3.2How the Extension Builder Works
  8. 5.3.3Target Audience
  9. 5.3.4Limitations
  10. 5.3.5Installation
  11. Extension Builder version
  12. 5.3.6Extension Properties
  13. Follow the instructions and examples
  14. Save your changes now!
  15. 5.3.7Domain Model
  16. The order of creating the objects matters
  17. 5.3.8Domain Model Properties
  18. Save your changes now!
  19. 5.3.9Domain Model Relations
  20. Save your changes now!
  21. 5.4Extension Activation
  22. 5.5Autoloading PHP Classes
  23. 5.6Recap

6.Analysing Initial Files

  1. 6.1Files Created by the Extension Builder
  2. 6.1.1Files in the Folder Classes/
  3. Consistent naming makes it easy
  4. 6.1.2Files in the Folder Configuration/
  5. 6.1.3Files in the Folder Resources/
  6. 6.1.4Files in the Folder Tests/
  7. 6.1.5Files in the Root Directory
  8. 6.2Additional Functionality of the Extension Builder
  9. 6.2.1Modifying the Model
  10. 6.3TypoScript constants and setup
  11. 6.4Recap

7.The CRUD Process

  1. 7.1Model-View-Controller in Extbase
  2. 7.2Creating an Object
  3. 7.2.1Create Action in Controller
  4. 7.2.2Creating the Template for the listAction()
  5. 7.2.3Side Note: Template Rendering
  6. Render a view without output
  7. 7.2.4Create Static Blogs
  8. 7.2.5Persisting Blogs
  9. 7.2.6How Persistence Works
  10. 7.2.7The PersistenceManager: Manual Persistence
  11. 7.2.8Create Your Own Action
  12. 7.2.9Form to Create an Object
  13. What to expect next
  14. 7.3Reading an Object
  15. 7.4Updating an Object
  16. 7.5Deleting an Object
  17. 7.5.1Exercise
  18. Action name deleteConfirm
  19. 7.6Fine-tuning of the Visual Appearance
  20. 7.6.1“Font Awesome” Icons
  21. 7.6.2List View: Align Buttons Right
  22. 7.6.3Button Margins
  23. 7.7Recap

8.Fluid Templating

  1. 8.1Templates, Layouts and Partials
  2. 8.2Using an Overall Layout
  3. 8.2.1Multiple Sections
  4. 8.2.2Optional Sections
  5. 8.3Partials
  6. 8.3.1Simple Partials
  7. Using sub-directories
  8. 8.3.2Complex Partials
  9. Passing arguments to partials
  10. 8.4Recap

9.Query Manager and Repositories

  1. 9.1Repository Class
  2. 9.2Magic Functions
  3. 9.3Default Structure of a Query
  4. 9.3.1Side Note: Debugging
  5. Not for the public!
  6. 9.4Adjusting Queries
  7. 9.4.1Determine Result Set
  8. 9.4.2Limiting Result Set
  9. 9.4.3Logical Conjunction
  10. 9.4.4Native SQL
  11. 9.4.5Query Settings
  12. 9.5Example: Search for Keyword in Title
  13. 9.6Dynamic Search in the Repository
  14. Converting special characters
  15. 9.7Side Note: Request Object
  16. 9.8Recap

10.TypoScript and FlexForm Configuration

  1. 10.1TypoScript
  2. 10.1.1Setup Scope
  3. 10.1.2Sub-keys
  4. 10.1.3Option: view
  5. 10.1.4Option: persistence
  6. 10.1.5Option: objects
  7. 10.1.6Option: features
  8. 10.1.7Option: mvc
  9. 10.1.8Option: settings
  10. 10.1.9Option: _LOCAL_LANG
  11. 10.1.10Option: _CSS_DEFAULT_STYLE
  12. 10.2FlexForms
  13. 10.2.1FlexForm Configuration
  14. Always click “save”
  15. 10.2.2Accessing the FlexForm Configuration
  16. 10.2.3Accessing Settings Outside of a Controller
  17. 10.2.4Switchable Controller Actions (SCA)
  18. Remove SCA configuration before continuing
  19. 10.3TypoScript for Backend Modules
  20. 10.4Adjustments for the Next Chapters
  21. 10.5Recap

11.Validation and Error Handling

  1. 11.1Point where Validation Happens
  2. 11.2Displaying Errors
  3. 11.2.1ViewHelper: Validation Results
  4. 11.3Validation Overview
  5. 11.4Property Validation
  6. 11.4.1Built-in Validators
  7. 11.4.2Multiple Validators
  8. 11.4.3Custom Validators
  9. 11.5Object Validation
  10. 11.6Action Validation
  11. 11.7Explicitly Ignore Validation
  12. 11.8Flash Messages
  13. 11.8.1Generating Flash Messages
  14. 11.8.2Displaying Flash Messages
  15. 11.8.3Flash Message Queues
  16. 11.8.4The Flash Message Queue in a Controller
  17. 11.8.5Practice Option
  18. 11.9Recap

12.ViewHelpers

  1. 12.1ViewHelpers in General
  2. 12.1.1Namespace
  3. 12.1.2PHP Class Files
  4. 12.2ViewHelpers in the TYPO3 Core
  5. 12.3ViewHelpers by the Community
  6. 12.4Custom ViewHelpers
  7. 12.4.1Text-ViewHelper
  8. 12.4.2TagBased-ViewHelper
  9. Universal tag attributes
  10. 12.4.3Condition-ViewHelper
  11. 12.4.4Widget-ViewHelper
  12. Make your ViewHelper foolproof
  13. Performance
  14. 12.5Test Your Knowledge
  15. 12.5.1Exercise: The Gravatar ViewHelper
  16. 12.5.2Exercise: The A-to-Z Widget
  17. 12.6Methods renderStatic() and render()
  18. 12.7Recap

13.Relations

  1. 13.1Relation in Domain Model
  2. 13.2The Table Configuration Array (TCA)
  3. 13.2.1TCA: ctrl
  4. 13.2.2TCA: interface
  5. 13.2.3TCA: types
  6. 13.2.4TCA: palettes
  7. 13.2.5TCA: columns
  8. Keep validation in sync
  9. 13.3The CRUD Process of Posts
  10. 13.3.1Preparation
  11. 13.3.2Create Posts
  12. 13.3.3Read Posts
  13. 13.3.4Update Posts
  14. 13.3.5Delete Posts
  15. 13.4m:n-Relations (Tags)
  16. 13.4.1Creation of Tags in the Backend
  17. 13.4.2Repository for Tags
  18. 13.4.3Read Tags in the Post Controller
  19. 13.4.4Templates and Partials Adjustments
  20. No need to explicitly store the tags
  21. 13.4.5Show Tags in List of Posts
  22. 13.51:1-Relations (Authors)
  23. 13.5.1Frontend Users and Groups
  24. 13.5.2Map Author to fe_users
  25. 13.5.3Implementing the Frontend Part
  26. 13.5.4Auto-Assign Frontend User
  27. 13.5.5Obfuscate Email Addresses
  28. 13.6Comments as AJAX Requests
  29. For didactic purposes
  30. 13.6.1Controller and Action
  31. 13.6.2Ajax Controller
  32. 13.6.3Display of Comments
  33. 13.6.4JavaScript
  34. Error handling
  35. 13.6.5AJAX Page Type in TypoScript
  36. 13.7Recap

14.Labels and Localization

  1. 14.1Why Use Language Files?
  2. 14.2Language Files
  3. 14.2.1Placeholders
  4. 14.2.2Variables
  5. 14.2.3Update all Template Files
  6. 14.3Overwrite Labels in TypoScript
  7. 14.4Language Configuration
  8. 14.4.1Website Language
  9. 14.4.2Site Configuration
  10. No need for these TypoScript settings
  11. 14.4.3Page Translation
  12. 14.4.4Content Element Translation
  13. Webserver configuration
  14. 14.5Localized Language File
  15. 14.5.1Overwrite Labels in TypoScript
  16. 14.6Language Labels in PHP
  17. 14.7Domain Object Localization
  18. Not a perfect example
  19. 14.7.1The Table Configuration Array (TCA)
  20. 14.7.2Translate Records
  21. 14.8Recap

15.Property Mapper and Type Converter

  1. 15.1Property Mapper
  2. 15.1.1Type Converter
  3. 15.1.2Property Mapper Configuration
  4. 15.2File Upload Functionality
  5. 15.2.1Security Aspects
  6. 15.2.2Blog Controller
  7. 15.2.3Upload FileReference Converter
  8. 15.2.4Blog Domain Model
  9. 15.2.5TCA of the Blog Domain Model
  10. 15.2.6FileReference Domain Model
  11. 15.2.7TypoScript
  12. 15.2.8Partials and Templates
  13. 15.2.9FormUpload-ViewHelper
  14. 15.3File Upload Test
  15. 15.4Recap

16.Backend Module

  1. 16.1Requirements and Solution Design
  2. 16.2Basic Components
  3. 16.2.1Module Registration
  4. 16.2.2Language File
  5. 16.2.3Abstract Backend Controller
  6. 16.3First Function: List Comments
  7. 16.3.1Comment Controller
  8. 16.3.2Fluid Templates
  9. 16.4Second Function: Dashboard
  10. 16.4.1Extend Module Registration
  11. 16.4.2Extend Action Menu
  12. 16.4.3Dashboard Controller
  13. 16.4.4Fluid Templates
  14. 16.4.5Visualise Statistical Data
  15. 16.4.6RequireJS
  16. 16.4.7AJAX in the TYPO3 Backend
  17. 16.4.8Add AJAX Functionality to JavaScript
  18. 16.4.9Fine-tuning and Additional Notes
  19. 16.5Styleguide Extension
  20. 16.5.1Installation
  21. 16.5.2Usage
  22. 16.6Recap

17.Clean-up and Finalisation

  1. 17.1Annotations
  2. 17.2PSR-2 Coding Standard (“PHP CodeSniffer”)
  3. 17.3DocBlocks (“phpDocumentor”)
  4. 17.4Documentation
  5. 17.5Recap

18.Security Basics

  1. 18.1TYPO3 Security Team
  2. 18.2Security in TYPO3 Extensions
  3. 18.3Most Common Security Vulnerabilities
  4. 18.3.1OWASP Top 10
  5. 18.3.2Injection Flaws
  6. 18.3.3Cross-site Scripting
  7. 18.3.4Cross-Site Request Forgery
  8. 18.3.5Lack of Access Control
  9. 18.4Further Typical Security Vulnerabilities

19.What’s Next

  1. 19.1Get Officially Certified

Appendix

  1. TYPO3 Release History
  2. Extension Declaration File
  3. References and Further Reading
  4. Unofficial Websites
  5. PHP Security
  6. Glossary
  7. Changelog

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.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, 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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub