1. Go to this page and download the library: Download naucon/form-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/ */
naucon / form-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Naucon\Bundle\FormBundle\NauconFormBundle(),
);
}
class DefaultController extends Controller
{
public function newAction(Request $request)
{
$user = new User();
$formFactory = $this->get('naucon_form.factory');
$form = $formFactory->createForm($user, 'user');
if ($form->isBound()
&& $form->isValid()) {
// some action, like saving the data to database
// redirect to success page
}
return $this->render('default/new.html.twig', array(
'form' => $form
));
}
}