Yii2的view需要链接跳转 添加 use yiihelpersUrl; view中的连接 <?= Url::toRoute('post/index');?>//post为你的当前控制器名,index为view模版