问题描述:

In my TopicType class, I used :

public function buildForm(FormBuilderInterface $builder, array $options)

{

$builder

->add('title', 'text')

->add('content', 'ckeditor', array(

'label' => 'Contenu',

'config_name' => 'my_custom_config',

'config' => array('language' => 'fr'),))

->add('save', 'submit')

;

}

How can I get autofocus on my first field "title", when i display the form?

网友答案:
$builder->add('title', 'text', array(
    'attr' => array(
        'autofocus' => true
        )
    );
相关阅读:
Top