tags:

views:

313

answers:

1

When creating an sfPropelRouteCollection, how can I edit the action names that the collection will generate?

For example:

# Routing for "product" CRUD
product:
  class:              sfPropelRouteCollection
  options:
    model:            Product
    module:           product
    actions:          [new, create, edit, update, delete]

How can I change the actual action that is called for any of the new/create/edit/update/delete methods? I'd like for them to call "ajaxNew," "ajaxCreate," etc. so the URL would look something like "product/ajaxNew", or the action for "update" would be "ajaxUpdate".

Let me know if I need to clarify further. Thanks.

A: 

use segment_names option

# Routing for "product" CRUD
product:
  class:              sfPropelRouteCollection
  options:
    model:            Product
    module:           product
    actions:          [new, create, edit, update, delete]
    segment_names:    { create: ajaxCreate, edit: ajaxEdit }
deresh
segment_names is changing what the action name is in the route, but not what it actually calls.
James Skidmore