Extbase - Formulare validieren

Aus Wikizone
Wechseln zu: Navigation, Suche

Das Extbase Validator Objekt

https://typo3.org/api/typo3cms/namespace_t_y_p_o3_1_1_c_m_s_1_1_extbase_1_1_validation_1_1_validator.html

http://www.typo3lexikon.de/typo3-tutorials/extensions/fluid/validators.html

Quickstart

Wird ein Model über das Frontend in einer newAction erstellt, so erfolgt die Validierung anhand der PHP Annotations im jeweiligen Model (typo3conf/ext/extension/Classes/Model/Beispiel.php), zum

Beispiel so:

/**
 * perName
 *
 * @var string
 * @validate NotEmpty
 */
 protected $perName = '';

Über das “@validate NotEmpty” wird sichergestellt, dass dieser Wert nicht leer sein darf.