PHP code example of codete / form-generator-bundle
1. Go to this page and download the library: Download codete/form-generator-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/**
* The first value in Field annotation specifies field's name.
*
* @Form\Field("reset", type=ResetType::class)
* @Form\Field("submit", type=SubmitType::class, "label"="Save")
*/
class Person
php
use Codete\FormGeneratorBundle\FormGenerator;
$generator = $this->get(FormGenerator::class);
$person = new Person();
$form = $generator->createFormBuilder($person)->getForm();
$form->handleRequest($request);