문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top