francisMi
francisMi

Reputation: 935

Silex/Symfony FormServiceProvider text in textarea

I'm using the FormServiceProvider in Silex to generate my forms. Now I want to put a default text in a generated textarea. (not a placeholder! && the attribute 'value' I use on my textfields doens't work on a textarea)

I know the text in a textarea is between the tags, but I don't find an option to fill this tags with my FormServiceProvider.

Is it possible?

Example code:

  $form = $app['form.factory']->createNamed('form')
       ->add('description', 'textarea',
            array('attr (??)' => array(' ??? (not placeholder or value!!) ??? ' => 'Default text')),
        )

Upvotes: 0

Views: 421

Answers (1)

francisMi
francisMi

Reputation: 935

The solution:

array('data' => 'Default text')

Upvotes: 1

Related Questions