开发者

Set new Default Folder / Controller

开发者 https://www.devze.com 2022-12-18 04:22 出处:网络
Is there a way to set a new Controller other than Home when a condition is met? I want to be able to specify a default controller other than Home when a user is logged in.

Is there a way to set a new Controller other than Home when a condition is met?

I want to be able to specify a default controller other than Home when a user is logged in.

So before a user logs in I want to use the default Home controller but once they have logged in I'd like to use say the User controller.

Better yet is there a way that I can use the following;

www.mysite.co开发者_StackOverflow中文版m/home/index when not logged in and, www.mysite.com/griegs when logged in.

www.mysite.com/griegs would then route to my User controller where 'griegs' is the Id/userName.


You can add to the global on start functions to intercept the requests before they hit the action itself... there you can check what's been requested (including the request URL) and redirect to a different action or the like as required.

0

精彩评论

暂无评论...
验证码 换一张
取 消