php - Symfony 3 form read only field? (with FOSUserbundle) -


using symfony 3 fosuserbundle, how make custom field of user registration read only)

in registrationformtype.php, buildform method tried:

->add('name', 'text', array('read_only' => true)) 

which gets invalidargumentexception

->add('name', 'text', array('read_only' => true)) 

which gets undefinedoptionsexception

try :

->add('name', textareatype::class, array(      'attr' => array(         'readonly' => true,        ),    )); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Python Tornado package error when running server -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -