Created
December 6, 2012 18:45
-
-
Save meze/4226993 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
... | |
$form = $this->createForm(new ContactType, new \test); | |
$form->bind((array('_token'=>'2f988dd5bee5917e4c7251ccce845885906eeea5', | |
'amount' => '123'))); | |
var_dump($form->isValid()); // true | |
return; |
This file contains hidden or 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 | |
class test { | |
public $amount; | |
} |
This file contains hidden or 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 App\AppBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; | |
class ContactType extends AbstractType | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder->add('amount', 'choice', array('choices' => array( | |
'test' =>'test' | |
))); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getName() | |
{ | |
return 'contact'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment