ameos/ameos_form

此扩展为基于extbase和fluid的TYPO3扩展提供表单API,包括验证、列表、搜索表单等。

安装次数: 571

依赖者: 1

建议者: 0

安全性: 0

星标: 3

关注者: 3

分支: 3

开放问题: 0

类型:typo3-cms-extension

2.1.1 2024-05-16 14:04 UTC

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扩展仓库中找到所有文档

http://docs.typo3.org/typo3cms/extensions/ameos_form/