Answer the question
In order to leave comments, you need to log in
Yii url manager, a question about creating a rule?
Hello. Something shut up in this question:
There is the following rule:
'rules'=>array(
'<view:(agreement|vendors|partners|about|howtobuy)>'=>'site/page',
'pages/<view:\w+>'=>'/site/page',
),
CController::createAbsoluteUrl('/site/page', array('view'=>'test')); //получаем 'site.ru/test'
CController::createAbsoluteUrl('/site/page', array('view'=>'vendors')); //получаем 'site.ru/vendors'
'<view:(agreement|vendors|partners|about|howtobuy)>'=>'site/page',
CController::createAbsoluteUrl('/site/page', array('view'=>'test')); //получаем 'site.ru/test'
CController::createAbsoluteUrl('/site/page', array('view'=>'vendors')); //получаем 'site.ru/vendors'
'pages/<view:\w+>'=>'/site/page',
Answer the question
In order to leave comments, you need to log in
The slash is superfluous, this indicates the controller / action
'rules'=>array(
'<view:(agreement|vendors|partners|about|howtobuy)>'=>'site/page',
'pages/<view:\w+>'=>'site/page',
),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question