Symfony'de rota koleksiyonları için eylem adlarını değiştirin?

1 Cevap php

Bir sfPropelRouteCollection oluştururken, nasıl toplama üretecek eylem adlarını düzenleyebilirsiniz?

Örneğin:

# 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 ürün / ajaxNew "böylece URL benzeyecektir vb" onlara "ajaxNew," "ajaxCreate, aramak için istiyorum", ya da için eylem "güncelleme ajaxUpdate" "olurdu" .

Ben daha açıklamak gerekirse haberim olsun. Teşekkürler.

1 Cevap

segment_names seçeneğini kullanın

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