ameos / ameos_form
此扩展为基于extbase和fluid的TYPO3扩展提供表单API,包括验证、列表、搜索表单等。
2.1.1
2024-05-16 14:04 UTC
Requires
- php: >=8.0.0
- typo3/cms-core: ^12
- typo3/cms-extbase: ^12
- typo3/cms-fluid: ^12
README
extbase和TYPO3的表单API
示例
$mymodel = $this->myModelRepository->findByUid($modelIdentifier);
$form = \Ameos\AmeosForm\Form\Factory::make('tx_myplugin', $mymodel);
$form->add('name', 'text')->addConstraint('name', 'required', 'Name is mandatory');
$form->add('email', 'email')->addConstraint('email', 'email', 'Email is not valid');
$form->add('submit', 'submit', array('label' => 'Send'));
if($form->isSubmitted()) {
$form->bindRequest($this->request);
if($form->isValid()) {
$this->myModelRepository->add($mymodel);
$this->addFlashMessage('New record created');
$this->redirect('index')
}
}
$this->view->assign('form', $form);
文档
您可以在TYPO3扩展仓库中找到所有文档