Created
December 20, 2012 15:50
-
-
Save clemherreman/4346105 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 | |
namespace Novadry\AvisBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilder; | |
use Symfony\Component\Form\FormView; | |
use Symfony\Component\Form\FormInterface; | |
use Novadry\AvisBundle\Form\WYSIWYG\CKEditorOptions; | |
class ReponseType extends AbstractType | |
{ | |
private $test; | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('description', 'ckeditor', array('toolbar' => CKEditorOptions::$defaultToolbar)) | |
; | |
} | |
public function getDefaultOptions(array $options) | |
{ | |
return array( | |
'data_class' => 'Novadry\AvisBundle\Entity\Reponse', | |
); | |
} | |
public function getName() | |
{ | |
return 'reponse_'.$this->test; | |
} | |
public function buildView(FormView $view, FormInterface $form) | |
{ | |
$this->test = $form->getData()->getAvis()->getId(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment