php - How to create this urlManager rule? -


first of all, excuse low english.

having following action in controller named webcontroller:

public function actionpage($view = 'index') {   try {     return $this->render('site/page/' . $view);   } catch (invalidparamexception $e) {     throw new httpexception(404);   } } 

i need rule following:

localhost/cookies  equals  localhost/?r=web/page&view=cookiesyprivacidad 

or

localhost/faq  equals  localhost/?r=web/page&view=preguntas 

something this:

'rules'=>array(    'cookies'=>'web/page' ) 

but adding fixed parameter.

you need this

'urlmanager' => array(   'rules' => array(     <view:(cookies|faq)>' => 'web/page'   ) ) 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -