2

I have a problem with my YII urlManager. urlManager Rules are not applying when urlFormat is 'get'. Here my urlManager code

'urlManager' => array(
   'urlFormat' => 'get',
   'showScriptName' => true,
   //'appendParams'=>false,
   'hostInfo'=>'My Base Url',
   'secureHostInfo'=>'My Secured Base Url',
   'ssl'=>false,
   'class'=>'myUrlManager',
   'rules' => array(
       array(
           'class' => 'application.components.MyBaseUrlManager',
           'connectionID' => 'db',
       ),
       '<controller:\w+>/<action:\w+>/*'=>'<controller>/<action>',
    ),
),

Here myUrlManager is extend class from CUrlManager and MyBaseUrlManager is extended class from CBaseUrlRule.

Is it possible to access the rules of urlManager when the urlformat is 'get'?

Thanks in Advance

darkheir
  • 8,844
  • 6
  • 45
  • 66
Srinivasa Reddy
  • 114
  • 1
  • 7
  • when the urlFormat is "path" everything is fine? Yeaf for me the access rules can be used with get format. Could you show us the code inside MyBaseUrlManager ? – darkheir Aug 02 '14 at 11:11
  • Yes for path everything is fine. But when the urlFormat changed to get MyBaseUrlManager not applying – Srinivasa Reddy Aug 04 '14 at 07:10

1 Answers1

0

You can access rules but these aren't processed or applied. See https://github.com/yiisoft/yii/blob/master/framework/web/CUrlManager.php#L214:

protected function processRules()
{
    if(empty($this->rules) || $this->getUrlFormat()===self::GET_FORMAT)
        return;
    ...
Sam Dark
  • 5,291
  • 1
  • 34
  • 52