Codeigniter4 How to switch controller based on user auth group |
Hello,
I have two view files: one for users and another for admins. Here is my current route: PHP Code: $routes->get('dashboard/index', ' Dashboard::index'); I want to change the view file based on the user's group. If Code: auth()->user()->inGroup("admin") How can I achieve this?
Create folders admin, user and concat in controller $group . "dashboard/index" or try if/else in view template
PHP Code: public function Redirect(): string Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
|
Welcome Guest, Not a member yet? Register Sign In |