Welcome Guest, Not a member yet? Register   Sign In
Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method)
#3

(This post was last modified: 07-15-2021, 10:09 PM by manager.)

For example you have a controller with name AuthController and a method showLoginPage which is used to show login page.
So you don't want url like example.com/authcontroller/showloginpage, but want it be like: example.com/login which should show login page.

To do this at first disable auto discovery functionality in Routes file: $routes->setAutoRoute(false);
After add this route to your routes file inside App/config folder:

$routes->group('', function ($routes) {  
    $routes->get('login',  'AuthController :: showLoginPage');
});
Reply


Messages In This Thread
RE: Remove /?home/ from URL (Remove Controller Name from URL And Leave Only Method) - by manager - 07-15-2021, 10:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB