企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
>[info] 请参考 http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html ### 路由的原理 默认路由 site/index ### 创建URL ~~~ php use yii\helpers\Url; echo Url::to(['post/index']); echo Url::to(['post/view', 'id' => 100]); ~~~ ### URL静态化 frontend\config\main.php ~~~ [ 'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableStrictParsing' => false, 'rules' => [ // ... ], ], ], ] ~~~