2
使用參數化路線時,有沒有辦法在我的onBeginRequest
事件處理程序中訪問重寫的$_GET
變量?如何獲取onBeginRequest中的URL命名參數?
我的路線定義爲:
'<_c:\w+>/<_a:\w+>/<id:\d+>' => '<_c>/<_a>'
我的事件處理程序是:
'onBeginRequest' => function($event) {
/*
site.com/posts/edit/1 - empty (bad)
site.com/posts/edit/?id=1 - not empty(good)
*/
var_dump($_GET);
die;
}
如何確保$ _GET [「身份證」]是指不管是哪的以上兩個網址是被要求的?
我正在使用Yii版本1.1.13。