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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -