hi everybody,

i'm new to symfony and to get my hands dirty i'm creating a
scaffolding bundle that allows basic crud operations in symfony2.

1. i created a mapped superclass mainly to supply id, created and
updated parameters to its sublasses as well as a getFormFields()
method called by the form for scaffolding of the form fields.

for the latter to work i need to read the mapping of the subclasses in
the superclass to choose the right form field depending on the column
type. the getClassMetadata() method of the entity manager would be
helpful so my question is: how can i retrieve the entity manager in
the managed superclass? or can i retrieve the metadata otherwise?

2. i'm using yaml to setup my routes. for my crud actions i have four
different routing patterns per scaffolded entity (index/create/edit/
delete). imagine 10 entities that would be 40 routes, all looking
almost the same:

adminuserindex:
    pattern:  /admin/user
    defaults: { _controller: AdminBundle:User:index }
adminusercreate:
    pattern:  /admin/user/form
    defaults: { _controller: AdminBundle:User:form }
adminuserupdate:
    pattern:  /admin/user/form/:id
    defaults: { _controller: AdminBundle:User:form }
adminuserdelete:
    pattern:  /admin/user/delete/:id
    defaults: { _controller: AdminBundle:User:delete }

since the pattern parameter supports variables (e.g. :id) and the
target is defined in defaults i assume that there might be another
parameter to do something like this maybe:

admindefault:
    pattern:  /admin/:entity/:action/:id
    target: { _bundel: admin, _controller: $entity, _action: $action,
_id: $id }
    defaults: { _controller: AdminBundle:User:delete }

the documentation is a little thin for obvious reasons. can anybody
help?

thanks

smindel

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to