【发布时间】:2016-10-25 20:16:41
【问题描述】:
我在 view/stock/three.php 中有自定义页面(我制作的),我在 StockController 中渲染它,我尝试使用
从 view/site/shop.php 打开它<div class="pager "><a href="<?= Yii::$app->urlManager->createUrl(['/stock/three']) ?>">3</a></div>
但我得到 Not Found (#404) Page not found. 。 (我没有忘记设置“使用网址”) 我也尝试从 SiteController 重定向它:
public function actionThree() {
return $this->redirect(['/stock/three']);
}
但也没有工作,仍然得到错误代码 404
【问题讨论】:
-
你的 UrlManager 配置是什么?
标签: view controller yii2-basic-app