2
votes

Is it possible in Yii UrlManager rules to set rule OR site/? For example there's "action Contacts in SiteController" and "controller MediController". Yii must use action from SiteController if it exists or user MediaController/index if not.

1

1 Answers

1
votes

In UrlManager, It will search from Top to Down.

So upto my knowledge, you can not define two CONTROLLER/ACTION for same Url alias.

But you can use controller forward in siteController. If your condition not satisfy then forward to mediaController.

$this->forward('media/index');

Hope helps !!