我有一个自定义字段类型'customnum',有一个DataTransformer。当给予Builder时,一切都在表单中正常工作:
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('number','customnum')
->add('active')
如何使用自定义字段(DataTransformer)从典型的indexAction页面开始,按照原则CRUD构建?
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('TwarSoz3Bundle:Organization')->findAll();
return array(
'entities' => $entities,
);
}
有没有办法让框架自动猜测该字段上的customnum类型(在表单中也是?)