Search code examples
phpsymfony-3.2

Providing readonly value in twig file returns null in symfony3.2


In my application form updation twig is as follows:

<div class="form-group">
    {{form_label(formUser.name)}} :
   <input class="form-control" disabled="disabled" value="{{formUser.name.vars.value}}" type="text">
   <input id="appbundle_user_name" name="appbundle_user[name]" value="{{formUser.name.vars.value}}" type="hidden">
</div>

It returns null value when updating the form how to solve this issue,to get the output?


Solution

  • disabled is not the same as readonly, it will not be included in the POST variables if that is where the value is null.