I am trying to set the default values for a new record managed by model admin. I've overridden the getCMSAddFormFields in the class Podcast extends DataObject. it works fine for generating the field, but in the ReadonlyField has a value of (none) when the add button is pressed in the model admin.
I'm still new to this, and don't fully understand the distinction between the model code, and the controller code, but I have a feeling that this is solved by a controller... but can extensions of dataobject even have controllers?
Please Help!!
public function getCMSAddFormFields() {
{
return new FieldSet(
new ReadonlyField(
$name = "Date",
$title = "Select a date",
$value = date("d/m/Y")
),
new TextField('Name'),
new TextareaField('Description')
);
}
}