Filter Group Codeigniter 4 |
These are my Routes.
PHP Code: $routes->setDefaultNamespace('App\Controllers'); Previously I set the Default Method with the name home and not with the name index. Now here's the problem, because my base_url is in .env = http: // localhost: 8080 / when I access the URL with localhost: 8080, codeigniter will look for it with the default index method not with the defaulf method that I set myself. Therefore, I keep creating an index method on my controller, then the index method will return a redirect to the first page I want to appear, this solution is perfect for the route group that I want to filter. My Controller : Code: <?php And My Filter CekAuth PHP Code: private $sesi; Hopefully it can help for those who have problems like me: D |
Messages In This Thread |
Filter Group Codeigniter 4 - by Rivaldy Saputra Agus - 03-19-2021, 11:42 PM
RE: Filter Group Codeigniter 4 - by Rivaldy Saputra Agus - 03-20-2021, 01:38 AM
RE: Filter Group Codeigniter 4 - by InsiteFX - 03-20-2021, 03:54 AM
RE: Filter Group Codeigniter 4 - by Rivaldy Saputra Agus - 03-20-2021, 05:12 PM
|