I have a field in my database that auto generate and show for user as read only / text.
How can I have a widget that will output only the text value of that field without put it into a <input> ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to show a read-only input element, in your form class (configure method) write:
On the other hand, you can show only field value. Use
$form->getObject()->get<field name>for this needs. In this case, you need to customize you form. See The Display Customization. Don’t forget to unset field in your form (unset($this['<field name>'])).