I'm starting to use the admin generator, but I found a problem :
Actually, the create action just contain a forward to the edit action but in some case, I need a completely different configuration between this two actions. Example :
- I have fields that haven't to be update after their creation ( for foreign key integrity)
- Some custom actions have to be enabled only on existing items ( ex : a "close ticket" action)
What am I proposing is the creation of a new configuration section in the generator.yml for the create action and, to keep the compatibility with the existing generator, a default value for this section to "edit" to forward create action to edit action.
Here is an example :
generator:
class: sfPropelAdminGenerator
param:
model_class: Book
theme: default
list:
display: [id, author_id, title]
object_actions:
_edit:
edit:
display: [id, author_id, title]
fields:
author_id: { params: disabled=true } ## We haven't to change the author of an existing book
id: { params: disabled=true } ## Don't touch the primary key
actions:
_list:
_save:
create:
display: [author_id, title] ## Don't need to show the primary key
actions:
_list:
_save: