我有 2 种不同的模型:类别和页面。我的 schema.yml:
propel:
wiki_category:
id: ~
address: { type: varchar(255) }
name: { type: varchar(255), required: true }
text: { type: longvarchar }
wiki_page:
id: ~
category_id: { type: integer, foreignTable: wiki_category, foreignReference: id, required: true}
address: { type: varchar(255) }
name: { type: varchar(255), required: true }
text: { type: longvarchar, required: true }
我的路由.yml:
category_show:
url: /:address.:sf_format
class: sfPropelRoute
options: { model: WikiCategory, type: object }
param: { module: category, action: show, sf_format: html }
requirements: { sf_method: get }
homepage:
url: /
param: { module: category, action: index }
page_show:
url: /:address/:address
class: sfPropelRoute
options: { model: WikiPage, type: object }
param: { module: page, action: show, sf_format: html }
requirements: { sf_method: get }
我想制作一条路线,例如/:address
(来自类别)/:address
(来自页面)
有没有办法做到这一点?
这个想法是制作一个类别页面,其中包含指向该类别页面的链接。通过按链接执行页面的动作显示。