【发布时间】:2016-04-29 20:48:56
【问题描述】:
我有一个页面类型“ProductPage”,它有导航到这样的标签:
/ProductPageUrlSegment/?tab=video
/ProductPageUrlSegment/?tab=audio
/ProductPageUrlSegment/?tab=photos
我希望在创建每个新产品页面时创建重定向,这样如果您导航 /ProductPageUrlSegment/video,它会转到 /ProductPageUrlSegment/?tab=video强>
所有选项卡都相同。我不清楚我应该使用路由https://docs.silverstripe.org/en/3.3/developer_guides/controllers/routing/ 还是重定向https://docs.silverstripe.org/en/3.3/developer_guides/controllers/redirection/
我有另一个项目的链接功能,它转到父页面
public function Link() {
return $this->Parent()->Link() . '#' . $this->URLSegment;
}
我的会是这样的:
public function LinkVideo() {
return $this->Link()->'/?=video' . '#' . $this->URLSegment->'/video';
}
我不具备解决此问题的知识,因此感谢任何指导。
【问题讨论】:
标签: php redirect url-rewriting silverstripe