2

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.

hamed
  • 7,939
  • 15
  • 60
  • 114

1 Answers1

1

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 !!

Sanjay Mohnani
  • 990
  • 7
  • 18