Skip to content

Commit ab70892

Browse files
authored
[TASK] Move Extbase Validation into one topic (#5467)
Preparation for #4605 Releases: main, 13.4, 12.4
1 parent 5545844 commit ab70892

File tree

11 files changed

+25
-15
lines changed

11 files changed

+25
-15
lines changed

Documentation/ApiOverview/RequestLifeCycle/Typo3Request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Extbase validator
7575
In Extbase validators the current request is available with
7676
`$this->getRequest()` if they extend the :php-short:`\TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator`:
7777

78-
.. literalinclude:: /ExtensionArchitecture/Extbase/Reference/Domain/_Validator/_RequestValidator.php
78+
.. literalinclude:: /ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_RequestValidator.php
7979
:caption: EXT:my_extension/Classes/Domain/Validators/MyCustomValidator.php
8080

8181
.. _typo3-request-viewhelper:

Documentation/ExtensionArchitecture/Extbase/Reference/Index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Extbase reference
1818
FrontendPlugins
1919
TypoScriptConfiguration
2020
Annotations
21-
Validation
21+
Validation/Index
2222
FileUpload
2323
Caching
2424
Localization

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/Validator.rst renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/Index.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
:navigation-title: Validator
1+
:navigation-title: Custom Validator
22

3-
.. include:: /Includes.rst.txt
4-
.. index:: Extbase; Validator
5-
.. _extbase_domain_validator:
3+
.. include:: /Includes.rst.txt
4+
.. index:: Extbase; Validator
5+
.. _extbase_domain_validator:
66

7-
=========================
8-
Custom Extbase Validators
9-
=========================
7+
=======================================
8+
Custom Extbase validator implementation
9+
=======================================
1010

1111
.. seealso::
1212
* :ref:`extbase_validation` for general validation in Extbase.
@@ -42,7 +42,7 @@ can be uniquely identified.
4242
This validator can be used for any string property of model now by including it
4343
in the annotation of that parameter:
4444

45-
.. literalinclude:: _CustomValidator/_PropertyValidatorUsage.php
45+
.. literalinclude:: _PropertyValidatorUsage.php
4646
:caption: EXT:blog_example/Classes/Domain/Model/Blog.php, modified
4747

4848
.. note::
@@ -68,7 +68,7 @@ function :php:`addErrorForProperty()` should be used instead of :php:`addError()
6868

6969
The validator is used as annotation in the action methods of the controller:
7070

71-
.. literalinclude:: _CustomValidator/_ObjectValidatorUsage.php
71+
.. literalinclude:: _ObjectValidatorUsage.php
7272
:caption: EXT:blog_example/Classes/Controller/BlogController.php, modified
7373

7474
.. _extbase_domain_validator-di:
@@ -79,7 +79,7 @@ Dependency injection in validators
7979
Extbase validators are capable of :ref:`dependency injection <Dependency-Injection>`
8080
without further configuration, you can use the constructor method:
8181

82-
.. literalinclude:: _Validator/_MyCustomValidator.php
82+
.. literalinclude:: _MyCustomValidator.php
8383
:caption: EXT:my_extension/Classes/Domain/Validators/MyCustomValidator.php
8484

8585
.. _extbase_domain_validator-request:
@@ -94,5 +94,5 @@ Request object in Extbase validators
9494
You can use the PSR-7 request object in a validator, for example to get
9595
the site settings:
9696

97-
.. literalinclude:: _Validator/_RequestValidator.php
97+
.. literalinclude:: _RequestValidator.php
9898
:caption: EXT:my_extension/Classes/Domain/Validators/MyCustomValidator.php

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_Validator/_MyCustomValidator.php renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_MyCustomValidator.php

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_CustomValidator/_ObjectValidator.rst.txt renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidator.rst.txt

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_CustomValidator/_ObjectValidatorUsage.php renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidatorUsage.php

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_CustomValidator/_PropertyValidator.rst.txt renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_PropertyValidator.rst.txt

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_CustomValidator/_PropertyValidatorUsage.php renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_PropertyValidatorUsage.php

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Domain/_Validator/_RequestValidator.php renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_RequestValidator.php

File renamed without changes.

Documentation/ExtensionArchitecture/Extbase/Reference/Validation.rst renamed to Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ It is also possible to write custom validators for properties or complete
2222
models. See chapter :ref:`Custom validators <extbase_domain_validator>` for
2323
more information.
2424

25+
26+
.. contents:: Table of contents
27+
28+
.. toctree::
29+
:caption: Subpages
30+
:glob:
31+
:titlesonly:
32+
33+
*/Index
34+
2535
.. _extbase-validation-why:
2636

2737
Why is validation needed?
@@ -82,7 +92,7 @@ You can define simple validation rules in the domain model by the annotation
8292

8393
**Example:**
8494

85-
.. literalinclude:: _Annotations/_Validate.php
95+
.. literalinclude:: ../_Annotations/_Validate.php
8696
:caption: EXT:blog_example/Classes/Domain/Model/Blog.php, modified
8797

8898
In this code section the validator :php:`StringLength` provided by Extbase
@@ -120,7 +130,7 @@ Annotations with arguments
120130
Annotations can be called with zero, one or more arguments. See the following
121131
examples:
122132

123-
.. literalinclude:: _Annotations/_Validate.php
133+
.. literalinclude:: ../_Annotations/_Validate.php
124134
:caption: EXT:blog_example/Classes/Domain/Model/Person.php, modified
125135

126136
Available validators shipped with Extbase can be found within

0 commit comments

Comments
 (0)