symfony - symfony2 form field label as an array -
i'd have 3 separate texts each field in form label. separate, because need styled differently. tried this:
$builder->add('total_sales', 'text', array( 'label' => array('num' => '1', 'descr' => 'total sales', 'category' => 'a'), 'required' => false, 'attr' => array( 'class' => 'field numeric_field', 'maxlength' => 10, )));
obviously above don't work; display 'array' in place of label. how can achieve desired effect?
first you'll need create custom form type extends text type, reason don't mess other text types might have elsewhere. after doing you'll need style using form_div_layout. can see details here: http://symfony.com/doc/current/cookbook/form/form_customization.html
Comments
Post a Comment