Hi Yii community,
I’m having problems with the route url in database
In file: main.php
'components' => array(
...
'urlManager' => array(
'class' => 'ext.MyUrlManager.MyUrlManager',
),
...
),
In folder extentions/MyUrlManager I have file MyUrlManager.php
class MyUrlManager extends CUrlManager{
public $dbTable = 'UrlRules';
protected function processRules(){
echo 123456;
/*$dbCommand = Yii::app()->db->createCommand("SELECT `pattern`, `route` FROM `{$this->dbTable}`")->execute();
$urlRules = $dbCommand->readAll();
foreach ($urlRules as $pattern => $route){
$this->rules[$pattern] = $route;
}*/
parent::processRules();
}
}
But it is empty. Please show me how to fix. Thanks