ShtumiUsefulBundle
ShtumiUsefulBundle copied to clipboard
Not working in form collections
My app has a form type (StockType) with an autocomplete field that works fine.
class StockType extends AbstractType {
public function buildForm(FormBuilder $builder, array $options) {
$builder
->add('product', 'shtumi_ajax_autocomplete', array(
'required' => true,
'entity_alias' => 'products',
'label' => 'Producto: ',
))
->add('amount', null);
}
// ...
}
Then I added a form collection named StockCollectionType:
class StockCollectionType extends AbstractType {
function buildForm(FormBuilder $builder, array $options) {
$builder
->add('items', 'collection', array(
'type' => 'stock_type',
'allow_add' => true,
'allow_delete' => true,
'by_reference' => false,
'options' => array('required' => true)
));
}
// ...
}
for some reason it seems not to be working.