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

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -