Skip to content

Instantly share code, notes, and snippets.

@yesez
Last active December 10, 2015 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesez/4372276 to your computer and use it in GitHub Desktop.
Save yesez/4372276 to your computer and use it in GitHub Desktop.
MensajeType
<?php
namespace UCA\SGExaBundle\Form;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
class MensajeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('titulo')
->add('destinatarios', 'genemu_jqueryselect2_entity', array(
'class' => 'UCA\SGExaBundle\Entity\Usuario',
'property' => 'email',
'multiple' => true,
))
->add('cuerpo', 'textarea', array(
'attr' => array(
'class' => 'tinymce',
'data-theme' => 'medium'
)
))
->add('plantilla', 'text', array(
'required' => false,
))
->add('plantillas', 'entity', array(
'class' => 'UCA\SGExaBundle\Entity\Plantilla',
'property' => 'nombre',
'expanded' => true,
'required' => false,
))
;
}
public function getDefaultOptions(array $options)
{
return array(
'data_class' => 'UCA\SGExaBundle\Entity\Mensaje',
);
}
public function getName(){
return "CreacionMensaje";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment