我正在尝试通过 http://www.yiiframework.com/doc-2.0/guide-helper-html.html#hyperlinks中提到的方法生成一个超链接,就像这样
Html::a('<b>Register</b>',
['story/create', array('id' =>39,'usr'=>'11')],
['class' => 'profile-link'])
我想得到像 story/create/id/39/usr/11
但它正在生成
story/create?1%5Bid%5D=39&1%5Busr%5D=1
我已经启用了 yii2 的 clean url 功能,比如
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
], also.
如何做到这一点?