Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony not editable form field

I am new to Symfony, and Im wondering whether there is a build in way to show a not editable input field within a form.(not hidden, not editable, so it just appears in a box)

I am using echo_field and doctrine model.

like image 231
user1279563 Avatar asked Feb 17 '23 12:02

user1279563


1 Answers

Just set the read_only attribute to true when you make the form.

$builder->add('dueDate', 'text', array('read_only' => true));

http://symfony.com/doc/master/reference/forms/types/text.html#read-only

like image 69
Cerad Avatar answered Feb 26 '23 18:02

Cerad