Created
February 8, 2011 16:01
-
-
Save johnwards/816648 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace WhiteOctober\FormBuilderBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use WhiteOctober\FormBuilderBundle\Document\FormBuilder; | |
use WhiteOctober\FormBuilderBundle\Document\Element; | |
use WhiteOctober\FormBuilderBundle\Form\FormBuilderForm; | |
use Symfony\Component\Form\Form; | |
use Symfony\Component\Form\TextField; | |
use Symfony\Component\Form\IntegerField; | |
class DefaultController extends Controller | |
{ | |
public function indexAction() | |
{ | |
$formBuilder = new FormBuilder(); | |
$form = FormBuilderForm::create($this->get('form.context')); | |
$form->bind($this->get('request'), $formBuilder); | |
// If the form has been submitted and validates... | |
if ($form->isValid()) { | |
exit("hello"); | |
} | |
return $this->render('FormBuilderBundle:Default:index.html.twig', array( | |
'form' => $form | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment