A continuación el la clase: ArticuloType:
Código PHP:
class ArticuloType extends AbstractType
{
/**
* @param FormBuilderInterface $builder
* @param array $options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('nombre')
->add('categoria',array(
'class'=> 'yonytestBundle:Categoria',
'query_builder'=> function(EntityRepository $er){
return $er->createQueryBuilder('c')
->where('c.estado','Activo');
}
));
}
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'yony\testBundle\Entity\Articulo'
));
}
/**
* @return string
*/
public function getName()
{
return 'yony_testbundle_articulo';
}
}
al ejecutar el formulario me sale el siguiente error:
Expected argument of type "string or Symfony\Component\Form\FormTypeInterface", "array" given