Skip to content

Instantly share code, notes, and snippets.

@clemherreman
Created December 20, 2012 15:50
Show Gist options
  • Save clemherreman/4346105 to your computer and use it in GitHub Desktop.
Save clemherreman/4346105 to your computer and use it in GitHub Desktop.
<?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