开发一个插件,我的插件目录中有一个 routing.yml,用 sfPropelRoute 指定一个路由。
在我的plugins/myPlugin/config/routing.yml 中:
myplugin_test:
url: /myurl/:id
class: sfPropelRoute
options: { model: myClass, type: object, method_for_criteria: selectAvailableObj }
params: { module: mymodule, action: show }
requirements:
sf_method: [GET, POST]
它工作正常。
但是,在我的应用程序(apps/myapp/config/routing.yml)中,我想定义一个绝对 URL,具有人类意义,我想做这样的路由:
my_profile:
url: /my-super-profile
class: sfRoute
params: { route: @myplugin_test, id: 1 }
显然,我的语法不正确!