Question

I have an object action approve and I'd like to change its url from /module/ListApprove/action?id=XXX to /module/:slug/approve. I have tried adding a route in routing.yml but no help. Also, I have ecexuteApprove defined in my action.

modified routing.yml:

poster_approve:
  url: /poster/:slug/approve
  params: {module: poster, action: approve}

poster:
  class: sfDoctrineRouteCollection
  options:
    model:                Poster
    module:               poster
    prefix_path:          /poster
    column:               slug
    with_wildcard_routes: true

when I manually call /poster/someslug/approve, it works fine. But in the admin list interface, in the actions column, the url for approve is not /poster/someslug/approve , instead it is /poster/ListApprove/action?id=12.

After it I added an action parameter to my generator.yml like this:

        object_actions:    
          _delete: 
            credentials: delete_poster
          approve:            
            credentials: approve_poster
            action:      approve

but the only change this time is, the link url becomes /poster/approve/action?id=12. How do I change this?

Was it helpful?

Solution

How does your routing.yml action look like? You could add something like:

list_approve:
  url:    /someModule/:slug/:id
  param:  { module: someModule, action: approve }

Please define but no help, what problem are you encountering?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top