buenos dias
El formulario esta creado en un formtype y no estarelacionado directamente a una entidad
Código PHP:
class ActivitiesType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$clsetiquetas = new TranslationExtension($this->em);
$builder
->add('campo1', 'checkbox', array(
'mapped' => false,
'required' => false,
'attr' => array(
'value' => 1
),
))
->add('campo2', 'text', array(
'mapped' => false,
'required' => false,
'attr' => array(
'disabled' => 'disabled',
),
))
->add('campo3', 'checkbox', array(
'mapped' => false,
'required' => false,
'attr' => array(
'value' => 2
),
));
->add('campo4', 'checkbox', array(
'mapped' => false,
'required' => false,
'attr' => array(
'value' => 2
),
));
->add('campo5', 'checkbox', array(
'mapped' => false,
'required' => false,
'attr' => array(
'value' => 2
),
));
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
//'data_class' => 'AppBundle\Entity\ToolActivities'
));
}
/**
* @return string
*/
public function getName()
{
return 'formActivities';
}