Form api for extbase and TYPO3
$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);
You can find all the documentation on the typo3 extension repository