Snippets tagged "form readonly"
- In the template
- Display the value:
- For a doctrine drop-down list:
$choices = $form['field_name']->getWidget()->getChoices();
echo $choices[$form['field_name']->getValue()];
- For a text field:
echo $form['field_name']->getValue()
- Hide the field:
<div style="display:none"><?php echo $form['field_name'] ?></div>
- In the form class, add this method:
public function update<FieldName>Column($value) {
return $this->isNew() ? <value_to_return_on_create> : false;
}
(Sorry for not formatting the code, but the code tag didn't work...)