I am trying to make a standard "created_at" field readonly in the edit form. Following the doc you have to add the following configuration:
MyEntity:
form:
fields:
- { property: 'created_at', type_options: { widget: 'single_text' } }
But it throws the following error:
An Exception was thrown while handling: The option "widget" does not exist. Defined options are: "action", "allow_extra_fields"...
Is there something obvious to add/modify ?
If you want to make the field read-only, you should probably use "disabled" option:
MyEntity:
form:
fields:
- { property: 'created_at', type_options: { disabled: true } }
If this doesn't work for you, can you try to set the form type explicitly?
MyEntity:
form:
fields:
- { property: 'created_at', type: 'datetime', type_options: { widget: 'single_text' } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With