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 -

reflection - How to access the object-members of an object declaration in kotlin -

python - TypeError('Unrecognized keyword arguments: ' + str(kwargs)) # Validate user data -