TASK: Fix smaller glitches

This commit is contained in:
Daniel Siepmann 2018-10-08 16:53:23 +02:00
parent 2094df147a
commit 08acce4619
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
4 changed files with 30 additions and 24 deletions

View file

@ -28,8 +28,8 @@ use Workshop\ExampleExtension\Domain\Repository\AddressRepository;
class AddressController extends ActionController
{
/**
* @var AddressRepository
*/
* @var AddressRepository
*/
protected $addressRepository;
public function __construct(AddressRepository $addressRepository)

View file

@ -9,23 +9,27 @@
4: 'city',
5: 'country'
}" as="propertyName">
<p>
<label for="{propertyName}">
{f:translate(id: 'labels.{propertyName}')}
</label>
<br>
<f:form.textfield property="{propertyName}" id="{propertyName}" />
{f:render(section: 'FieldErrors', arguments: {
propertyPath: 'address.{propertyName}'
})}
<br>
</p>
{f:render(section: 'Field', arguments: {
propertyName: propertyName
})}
</f:for>
<br>
<f:form.submit value="Update" />
</f:form>
<f:section name="Field">
<p>
<label for="{propertyName}">{f:translate(id: 'labels.{propertyName}')}</label>
<br>
<f:form.textfield property="{propertyName}" id="{propertyName}" />
{f:render(section: 'FieldErrors', arguments: {
propertyPath: 'address.{propertyName}'
})}
<br>
</p>
</f:section>
<f:section name="FieldErrors">
<f:form.validationResults for="{propertyPath}">
<f:for each="{validationResults.flattenedErrors}" as="errors">

View file

@ -106,7 +106,6 @@ Before v9, the file would look like:
KEY parent (pid)
);
Model
-----
@ -125,7 +124,7 @@ Each model is a PHP class structure like:
.. literalinclude:: ../../CodeExamples/localPackages/example_extension/Classes/Domain/Model/Address.php
:language: php
:linenos:
:lines: 1-4,24-32,63-66,87
:lines: 1-4,24-29,31-32,64-68,119
Repository
----------
@ -178,7 +177,7 @@ to the view:
:lines: 28-29,40-43,66
The ``AddressRepository`` extends the base ``Repository`` class and inherits some
methods, e.g. ``findAll``.
methods, e.g. ``findAll()``.
Template
--------

View file

@ -9,16 +9,16 @@ only need :file:`ext_tables.sql` the TCA and TypoScript for rendering.
Extbase is needed if you provide interaction to the user, e.g. updating or adding
records.
Even that can nowadays achieved using the system extension "Form". Still we will
Even that can nowadays be achieved using the system extension "Form". Still we will
cover how to update a record next.
We need a form where we can adjust the values of the record, e.g. change the
companies name.
company name.
Therefore we will add a new ``editAction()``. This will receive a single ``Address``
for editing and provides the form. We also will add an ``updateAction()`` which
receives a single ``Address``. This action is the target of the submit form and will
update the database record.
for editing and provides the form. We also add an ``updateAction()`` which receives a
single ``Address``. This action is the target of the submit form and will update the
database record.
To start editing an address, we will add an link from :file:`index.html` to
``editAction()``.
@ -50,7 +50,7 @@ Creating Forms
Create a form which will show the current values of a single ``Address`` to the
user.
TYPO3 also provides ViewHelpers to create forms. Of course you could create form with
TYPO3 also provides ViewHelpers to create forms. Of course you could create forms with
pure HTML, but TYPO3 / Fluid adds some security aspects and makes things easier.
E.g. a proper validation that forms were not manipulated are added out of the box.
@ -229,6 +229,8 @@ Germany. One or more leading 0 are allowed, we therefore will not use the PHP ty
*/
protected $zip;
Also see: https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.3/Feature-83167-ReplaceValidateWithTYPO3CMSExtbaseAnnotationValidate.html
Display validation errors
-------------------------
@ -274,9 +276,10 @@ Handling existing invalid records
---------------------------------
In some circumstances your system might have an invalid record. Right now it's not
possible to edit this record with `editAction` as Extbase will validate the record.
possible to edit this record with ``editAction()`` as Extbase will validate the
record.
Therefore the `@ignorevalidation` annotation can be added to the action::
Therefore the ``@ignorevalidation`` annotation can be added to the action::
/**
* @ignorevalidation $address