0
votes

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.

1

1 Answers

0
votes

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 }