Question

If I use Yii::app()->createUrl('user/login') i will get the result as '/user/login'

But I will use Yii::app()->createUrl('user/login') inside a module i will get '/module/user/login'

Is there any way so that I can '/user/login' irrespective of from where createUrl is called?

I am using a common function which returns the url.

Était-ce utile?

La solution

Yii::app()->createUrl('//user/login')

will work for you. The // refers to the application root. To access controllers inside other modules you can use //module/controller/action

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top