I want to set the value on a textarea widget. How i can set default value for textarea in Symfony 3 for TextType(input type="text") i can use value parameter but for textarea i can not!!!how i can set default value for textarea.
this is my buildForm
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('linkdin', TextType::class, array('attr' => array('placeholder' =>
'linkdin','class' => 'form-control width100','value' =>
MainPageType::$content1[0]['linkdin'])))
->add('addres', CKEditorType::class, array('attr' => array('required' =>
'false','name'=>'editor1' ,'id' => 'editor1','class' => 'ckeditor','empty_data'
=> MainPageType::$content1[0]['addres'])))
.
.
$YourData
you should transfer the object you are willing to display in the form. Editing the object value before you transfer it into the form is considered bad programming. – Geophyte