【发布时间】:2013-12-24 01:55:35
【问题描述】:
我的 Yii urlManager 有问题。我正在使用路径格式并希望传递多个 get 变量。网址如下所示:
/Yii/app/de/user/admin/id/5/test/hello
我的 .htaccess:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteBase /Yii/app/
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
我尝试使用 urlManager,但它不适用于以下规则:
'rules' => array(
'<language:\w+>/<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<language:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<language:\w+>/<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
)
$_GET 应该如下所示:
array(3) {
["/de/user/admin"]=> string(0) ""
["id"]=> string(1) "5"
["test"]=> string(5) "hello"
["language"]=> string(2) "de"
}
它必须适用于可变数量的获取参数。例如:
如果使用ajax按CGridView排序,参数个数不同。
谢谢
【问题讨论】: