我在main.php中使用了url规则。但它会影响所有控制器。如何才能为特定控制器设置网址规则?
'rules' => array(
// custom rule
array(
'class' => 'application.components.MyUrlRule',
'connectionID' => 'db',
),
)
MyUrlRule
class MyUrlRule extends CBaseUrlRule{
public $connectionID = 'db';
public function createUrl($manager,$route,$params,$ampersand)
{
//modification & url encryption
}
public function parseUrl($manager,$request,$pathInfo,$rawPathInfo)
{
//modification & url decryption
}
}