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
Post a Comment