1

我试图允许在 YII (Yii 1.1.14) 中访问 $_GET 以获取干净的 url 和正常的 get 请求,例如,如果我有一个控制器 Cities 和 action getCities 仅 var_dump($_GET)

1- http://example.com/cities/getCities/country_id/100
==> 输出是array(1) { ["country_id"]=> string(3) "100" }
2- http://example.com/cities/getCities?country_id=100
==> 输出是array(0) { }

我的 urlManager 是

'urlManager' => 数组(
    'class' => 'ext.localeurls.LocaleUrlManager',
    'languageParam' => 'lang', // 构造 URL 时包含所需语言的参数名称
    'urlFormat' => '路径',
    'showScriptName' => 假,
    '大小写敏感' => 假,
    '规则'=>数组(
        '登录'=>'/home/登录'
    )
),

在上述两种情况下,我如何让 Yii 识别 $_GET ?

编辑 我正在使用 nginx 1.6。GET params (?x=y) 在其他 Yii 项目上运行良好,只有这个项目没有。我将网络服务器更改为 apache,并让它在这个项目上工作!!!虽然这个项目和其他项目有相同的 nginx 配置!!

4

0 回答 0