Skip to content

Commit 7c2b7e1

Browse files
authored
[TASK] Improve syntax and titles in Extbase chapters (#5436)
Releases: main, 13.4
1 parent 01864e8 commit 7c2b7e1

File tree

20 files changed

+349
-258
lines changed

20 files changed

+349
-258
lines changed

Documentation/ExtensionArchitecture/Extbase/Examples/Index.rst

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:navigation-title: Examples
2-
.. include:: /Includes.rst.txt
2+
.. include:: /Includes.rst.txt
33

4-
.. index:: Extbase; Examples
5-
.. _extbase_examples:
4+
.. index:: Extbase; Examples
5+
.. _extbase-examples:
66

77
================
88
Extbase Examples
@@ -11,9 +11,13 @@ Extbase Examples
1111
.. contents::
1212
:local:
1313

14+
.. _extbase-examples-extensions:
15+
1416
Example extensions
1517
==================
1618

19+
.. _extbase-examples-extensions-tea:
20+
1721
Tea example
1822
-----------
1923

@@ -23,25 +27,37 @@ unit/functional/acceptance testing and continuous integration.
2327

2428
You can also use this extension to manage your collection of delicious teas.
2529

30+
.. _extbase-examples-extensions-blog:
31+
2632
Blog example
2733
------------
2834

29-
The extension :composer:`t3docs/blog-example` contains working examples of all the features documented in the :ref:`Extbase Reference <extbase_reference>` manual.
35+
The extension :composer:`t3docs/blog-example` contains working examples of all
36+
the features documented in the :ref:`Extbase Reference <extbase_reference>` manual.
3037

31-
This extension should not be used as a base for building your own extension or used to blog in a live environment.
38+
This extension should not be used as a base for building your own extension
39+
or used to blog in a live environment.
3240

33-
If you want to set up a blog, take a look at the :composer:`t3docs/blog-example` extension or combine :composer:`georgringer/news` with a comment extension of your choice.
41+
If you want to set up a blog, take a look at the :composer:`t3docs/blog-example`
42+
extension or combine :composer:`georgringer/news` with a comment extension of
43+
your choice.
44+
45+
.. _extbase-examples-extensions-real-world:
3446

3547
Real-world examples
3648
===================
3749

50+
.. _extbase-examples-user-module:
51+
3852
Backend user module
3953
-------------------
4054

4155
In the TYPO3 Core, the system extension :composer:`typo3/cms-beuser` has backend modules
4256
based on Extbase. It can therefore be used as a guide on how to develop
4357
backend modules with Extbase.
4458

59+
.. _extbase-examples-extensions-news:
60+
4561
News
4662
----
4763

Documentation/ExtensionArchitecture/Extbase/Index.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
.. include:: /Includes.rst.txt
2-
.. index::
3-
pair: Extension development; Extbase
1+
:navigation-title: Extbase
42

5-
.. _extbase:
3+
.. include:: /Includes.rst.txt
4+
.. index::
5+
pair: Extension development; Extbase
6+
.. _extbase:
67

7-
=======
8-
Extbase
9-
=======
8+
=====================================
9+
Extbase: Extension framework in TYPO3
10+
=====================================
1011

1112
Extbase is an extension framework to create TYPO3 frontend plugins and TYPO3
1213
backend modules. Extbase can be used to develop extensions but it does not

Documentation/ExtensionArchitecture/Extbase/Introduction/Index.rst

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
:navigation-title: Introduction
2-
.. include:: /Includes.rst.txt
3-
.. index::
4-
pair: Extension development; Extbase introduction
52

6-
.. _extbase-introduction:
3+
.. include:: /Includes.rst.txt
4+
.. index::
5+
pair: Extension development; Extbase introduction
6+
7+
.. _extbase-introduction:
78

89
====================
910
Extbase introduction
1011
====================
1112

12-
.. todo:: Refer to a good example, e.g. tea, blog_example?
13+
.. todo:: Refer to a good example, e.g. tea, blog_example?
14+
15+
.. todo:: Add tips how to get more information or help
1316

14-
.. todo:: Add tips how to get more information or help
17+
.. _extbase-introduction-what-is:
1518

1619
What is Extbase?
1720
================
@@ -43,13 +46,14 @@ Thus, many things, such as backend modules or plugins can be done "the Extbase
4346
way" or "the Core way". This is a design decision, the extension developer must
4447
make for the specific use case.
4548

46-
.. attention::
49+
.. attention::
4750

48-
Extbase is one of many options in the "toolbox" of TYPO3 extension development.
51+
Extbase is one of many options in the "toolbox" of TYPO3 extension development.
4952

50-
TYPO3 is flexible, often provides several approaches for one thing and it is
51-
up to the extension developer to make an informed choice.
53+
TYPO3 is flexible, often provides several approaches for one thing and it is
54+
up to the extension developer to make an informed choice.
5255

56+
.. _extbase-introduction-or-not:
5357

5458
Extbase or not?
5559
===============
@@ -61,20 +65,20 @@ guidance):
6165

6266
Use Extbase if you:
6367

64-
* wish to get started quickly, e.g. using the
65-
:ref:`extension_builder <extension-builder>`
66-
* are a beginner or do not have much experience with TYPO3
67-
* want to create a "classic" Extbase extension with plugins and (possibly)
68-
backend modules (as created with the extension_builder)
68+
* wish to get started quickly, e.g. using the
69+
:ref:`extension_builder <extension-builder>`
70+
* are a beginner or do not have much experience with TYPO3
71+
* want to create a "classic" Extbase extension with plugins and (possibly)
72+
backend modules (as created with the extension_builder)
6973

7074
Do not use Extbase
7175

72-
* if performance might be an issue with the "classic" Extbase approach
73-
* if there is no benefit from using the Extbase approach
74-
* if you are writing an extension where Extbase does not add any or much value,
75-
e.g. an extension consisting only of Backend modules, a site package, a
76-
collection of content elements, an Extension which is used as a command line
77-
tool.
76+
* if performance might be an issue with the "classic" Extbase approach
77+
* if there is no benefit from using the Extbase approach
78+
* if you are writing an extension where Extbase does not add any or much value,
79+
e.g. an extension consisting only of Backend modules, a site package, a
80+
collection of content elements, an Extension which is used as a command line
81+
tool.
7882

7983
There is also the possibility to use a "mixed" approach, e.g. use Extbase
8084
controllers, but do not use the persistence of Extbase. Use TYPO3
@@ -89,7 +93,7 @@ using "lazy initialization" which is supported within Extbase.
8993
However, if you use the "mixed" approach, you will not get some of the
9094
advantages of Extbase and have to write more code yourself.
9195

92-
.. seealso::
96+
.. seealso::
9397

94-
For more information to get started with Extension development, see
95-
:ref:`extension-create-new`.
98+
For more information to get started with Extension development, see
99+
:ref:`extension-create-new`.

Documentation/ExtensionArchitecture/Extbase/Reference/Annotations.rst

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
.. include:: /Includes.rst.txt
1+
:navigation-title: Annotations
22

3-
.. index:: Extbase; Annotations
4-
.. _extbase-annotations:
3+
.. include:: /Includes.rst.txt
4+
.. index:: Extbase; Annotations
5+
.. _extbase-annotations:
56

6-
===========
7-
Annotations
8-
===========
7+
======================
8+
Annotations in Extbase
9+
======================
910

1011
All available annotations for Extbase delivered by TYPO3 Core are placed within
1112
the namespace :php:`\TYPO3\CMS\Extbase\Annotation`.
@@ -16,12 +17,14 @@ for the annotation :php:`Lazy`:
1617
.. literalinclude:: _Annotations/_Lazy.php
1718
:caption: EXT:blog_example/Classes/Domain/Model/Blog.php, modified
1819

20+
.. _extbase-annotations-internal:
21+
1922
Annotations provided by Extbase
2023
===============================
2124

2225
The following annotations are provided Extbase:
2326

24-
.. _extbase-annotation-validate:
27+
.. _extbase-annotation-validate:
2528

2629
Validate
2730
--------
@@ -39,7 +42,7 @@ Can be used in the context of a model property.
3942
`Validate` annotations for a controller action are executed additionally
4043
to possible domain model validators.
4144

42-
.. _extbase-annotation-ignore-validation:
45+
.. _extbase-annotation-ignore-validation:
4346

4447
IgnoreValidation
4548
----------------
@@ -66,14 +69,14 @@ Read more about this on https://usetypo3.com/dtos-in-extbase/ or see a
6669
:abbr:`CRUD (Create, Read, Update, Delete)` example for this on
6770
https://github.com/garvinhicking/gh_validationdummy/
6871

69-
.. _extbase-annotation-orm:
72+
.. _extbase-annotation-orm:
7073

7174
ORM (object relational model) annotations
7275
------------------------------------------
7376

7477
The following annotations can only be used on model properties:
7578

76-
.. _extbase-annotation-cascade:
79+
.. _extbase-annotation-cascade:
7780

7881
Cascade
7982
~~~~~~~
@@ -88,7 +91,7 @@ Extbase only supports the option "remove".
8891
.. literalinclude:: _Annotations/_Cascade.php
8992
:caption: EXT:blog_example/Classes/Domain/Model/Blog.php, modified
9093

91-
.. _extbase-annotation-transient:
94+
.. _extbase-annotation-transient:
9295

9396
Transient
9497
~~~~~~~~~
@@ -101,23 +104,23 @@ Transient
101104
.. literalinclude:: _Annotations/_Transient.php
102105
:caption: EXT:blog_example/Classes/Domain/Model/Post.php, modified
103106

104-
.. _extbase-annotation-lazy:
107+
.. _extbase-annotation-lazy:
105108

106109
Lazy
107110
~~~~
108111

109112
:php:`\TYPO3\CMS\Extbase\Annotation\ORM\Lazy`: Marks model property to be loaded
110113
lazily on first access.
111114

112-
.. note::
115+
.. note::
113116
Lazy loading can greatly improve the performance of your actions.
114117

115118
**Example:**
116119

117120
.. literalinclude:: _Annotations/_Lazy.php
118121
:caption: EXT:blog_example/Classes/Domain/Model/Post.php, modified
119122

120-
.. _extbase-annotation-combine:
123+
.. _extbase-annotation-combine:
121124

122125
Combining annotations
123126
=====================

Documentation/ExtensionArchitecture/Extbase/Reference/Caching.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
.. include:: /Includes.rst.txt
1+
:navigation-title: Caching
22

3-
.. index:: Extbase; Caching
4-
.. _extbase_caching:
3+
.. include:: /Includes.rst.txt
4+
.. index:: Extbase; Caching
5+
.. _extbase_caching:
56

6-
==============================
7-
Caching
8-
==============================
7+
==========================
8+
Caching in Extbase plugins
9+
==========================
910

1011
Extbase clears the TYPO3 cache automatically for update processes. This is called
1112
*Automatic cache clearing*. This functionality is activated by default. If a domain object is

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
.. include:: /Includes.rst.txt
1+
:navigation-title: ActionController
22

3+
.. include:: /Includes.rst.txt
34
.. index:: Extbase; ActionController
45
.. _extbase-action-controller:
56

6-
================
7-
ActionController
8-
================
7+
==============================
8+
Extending the ActionController
9+
==============================
910

1011
Most Extbase controllers are based on the
1112
:php:`\TYPO3\CMS\Extbase\Mvc\Controller\ActionController`. It is theoretically
@@ -138,6 +139,8 @@ like this:
138139
.. literalinclude:: _Snippets/_ActionController/_ext_localconf.php
139140
:caption: EXT:blog_example/ext_localconf.php (Excerpt)
140141

142+
.. _extbase-action-controller-stop:
143+
141144
Stop further processing in a controller's action
142145
================================================
143146

@@ -194,6 +197,8 @@ you can return a specific object through the :php:`responseFactory`:
194197
If you want to return a JSON response, see :ref:`extbase_responses` to achieve this
195198
with a special :php:`$this->jsonResponse()` method.
196199

200+
.. _extbase-action-controller-events:
201+
197202
Events
198203
======
199204

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.. include:: /Includes.rst.txt
2-
.. index::
3-
Extbase; Errors
4-
Extbase; errorAction
5-
.. _extbase_error_action:
1+
.. include:: /Includes.rst.txt
2+
.. index::
3+
Extbase; Errors
4+
Extbase; errorAction
5+
.. _extbase_error_action:
66

77
============
88
Error action
@@ -12,25 +12,27 @@ Extbase offers an out of the box handling for errors. Errors might occur during
1212
the mapping of incoming action arguments. For example, an argument can not
1313
be mapped or validation did not pass.
1414

15+
.. _extbase_error_action-howto:
16+
1517
How it works
1618
============
1719

18-
#. Extbase will try to map all arguments within :php:`ActionController`. During
19-
this process arguments will also be validated.
20+
#. Extbase will try to map all arguments within :php:`ActionController`. During
21+
this process arguments will also be validated.
2022

21-
#. If an error occurred, the class will call the :php:`$this->errorMethodName`
22-
instead of determined :php:`$this->actionMethodName`.
23+
#. If an error occurred, the class will call the :php:`$this->errorMethodName`
24+
instead of determined :php:`$this->actionMethodName`.
2325

24-
#. The default is to call :php:`errorAction()` which will:
26+
#. The default is to call :php:`errorAction()` which will:
2527

26-
#. Clear cache in case :typoscript:`persistence.enableAutomaticCacheClearing` is
27-
activated and current scope is frontend.
28+
#. Clear cache in case :typoscript:`persistence.enableAutomaticCacheClearing` is
29+
activated and current scope is frontend.
2830

29-
#. Add an error :ref:`Flash Message <flash-messages>`
30-
by calling :php:`addErrorFlashMessage()`.
31-
It will in turn call :php:`getErrorFlashMessage()` to retrieve the
32-
message to show.
31+
#. Add an error :ref:`Flash Message <flash-messages>`
32+
by calling :php:`addErrorFlashMessage()`.
33+
It will in turn call :php:`getErrorFlashMessage()` to retrieve the
34+
message to show.
3335

34-
#. Return the user to the referring request URL. If no referrer exists, a plain text
35-
message will be displayed, fetched from
36-
:php:`getFlattenedValidationErrorMessage()`.
36+
#. Return the user to the referring request URL. If no referrer exists, a plain text
37+
message will be displayed, fetched from
38+
:php:`getFlattenedValidationErrorMessage()`.

0 commit comments

Comments
 (0)