Skip to content

Commit f72073b

Browse files
authored
[DOCS] Improve Extbase controller overview (#5911)
Releases: main, 13.4, 12.4
1 parent 75a7376 commit f72073b

File tree

2 files changed

+45
-7
lines changed
  • Documentation/ExtensionArchitecture/Extbase/Reference

2 files changed

+45
-7
lines changed

Documentation/ExtensionArchitecture/Extbase/Reference/Controller/Index.rst

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
:navigation-title: Controller
22

33
.. include:: /Includes.rst.txt
4-
.. index:: Extbase; View
4+
.. index:: Extbase; Controller
55
.. _extbase-controller:
66

77
==================
8-
Extbase Controller
8+
Extbase controller
99
==================
1010

11+
Extbase controllers are the main entry point for handling requests in TYPO3's
12+
Extbase framework. They interpret incoming URLs, map and validate request data,
13+
and delegate tasks to your domain logic through well-structured, object-oriented
14+
code.
15+
16+
Controllers serve as a bridge between the request and the response:
17+
18+
- They call actions based on routing.
19+
- They use `Dependency injection <https://docs.typo3.org/permalink/
20+
t3coreapi:dependency-injection>`_ to access services and repositories.
21+
- They validate input using the `Extbase property mapper <https://docs.typo3.org/
22+
permalink/t3coreapi:extbase-property-mapping>`_ and optionally apply
23+
additional validation rules via
24+
`Using validation for Extbase models and controllers <https://docs.typo3.org/
25+
permalink/t3coreapi:extbase-validation>`_.
26+
- They prepare and assign data to the
27+
`Extbase view <https://docs.typo3.org/permalink/t3coreapi:extbase-view>`_.
28+
- They return the final response – typically rendered with
29+
`Fluid <https://docs.typo3.org/permalink/t3coreapi:fluid>`_ templates.
30+
31+
Error handling is built-in via a dedicated
32+
`Error action <https://docs.typo3.org/permalink/t3coreapi:extbase-error-action>`_,
33+
ensuring robust and predictable behavior in case something goes wrong.
34+
35+
To make a controller callable, it must be registered in a plugin configuration.
36+
This tells TYPO3 which controller and actions are available in which context.
37+
38+
See `Extbase plugins <https://docs.typo3.org/permalink/t3coreapi:plugins-extbase>`_
39+
for details.
40+
1141
**Contents:**
1242

1343
.. toctree::
@@ -18,3 +48,7 @@ Extbase Controller
1848
ErrorAction
1949
PropertyMapping
2050
TypeConverter
51+
52+
.. seealso::
53+
If you are using the :composer:`stefanfroemken/ext-kickstarter` you can use
54+
command `vendor/bin/typo3 make:controller` to generate a controller.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/Repository/Index.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
.. include:: /Includes.rst.txt
1+
:navigation-title: Repository
22

3+
.. include:: /Includes.rst.txt
34
.. index:: Extbase; Repositories
45
.. _extbase-repository:
56

6-
==========
7-
Repository
8-
==========
7+
==================
8+
Extbase repository
9+
==================
910

1011
All :ref:`Extbase <extbase>` repositories inherit from
1112
:php:`\TYPO3\CMS\Extbase\Persistence\Repository`.
1213

1314
A repository is always responsible for precisely one type of
14-
:ref:`domain object <extbase-model>`.
15+
:ref:`domain object (model) <extbase-model>`.
1516

1617
The naming of the repositories is important:
1718
If the domain object is, for example, *Blog* (with full name
@@ -30,6 +31,9 @@ The :php:`BlogRepository` sets some default orderings and is otherwise empty:
3031
.. contents:: **Table of contents**
3132
:local:
3233

34+
.. seealso::
35+
If you are using the :composer:`stefanfroemken/ext-kickstarter` you can use
36+
command `vendor/bin/typo3 make:repository` to generate an Extbase repository.
3337

3438
.. _extbase-repository-find-methods:
3539

0 commit comments

Comments
 (0)