In the last chapter, you told about Each and Every Controller. In this chapter, you are telling about Dashboard controller, all methods in that. What about if we want to have for all the controllers and methods, barring two or three. E.g if we have 50 methods, we need it for 47, and dont need it for 3. Is there any method for that?
hello, So, do we need to put all controller class name and method? Then for the large numbers of controllers and with each controller containing a large number of method, would be long lists. Is it not possible just applied to controllers only, so that it will apply for each method of all controllers like in CI3 By extending MY_Controller or including the controller and extending to that controller. Or just including on __construct() method of each class in CI3.
@@GoPHP How it can be implemented please guide me, I m working on a multi-login system. I want to show specific navigation to non-admin users by using filters
$routes->group('admin', ['filter'=>'isLoggedIn'], function($routes){ $routes->group('dashboard', function($routes){ $routes->add('/', 'Dashboard::index'); $routes->add('show', 'Dashboard::show'); }); }); I have created this admin routes group and the filter is not working on the admin routes group. When I use the filter in the dashboard group it works fine like this $routes->group('dashboard', ['filter'=>'isLoggedIn'], function($routes); please suggest solution
Agr mai controller ko hi restricted krna chahu to Aapne jo method bataya usme bar bar hr method ka route banana padega aisa na krna pde pore controller m ek bar m ho jay iske liy kaise kre ??
In CI3, For page redirection, we have a method redirect(); if we want to redirect all the controller methods, then we can write redirect() method in constructor function. this will woks But In CI4, for page redirection, we have a method return redirect()->to('/path'); constructor does not return any value. So, return redirect()->to('/path'); this wont work in side constructor for more info. please check the CodeIgniter forum link forum.codeigniter.com/thread-74537.html So, I think its better to restrict controllers access using routing in CI4
Thank you sir, your tutorial is just awesome, interesting and easy to get sir
Thank You
thanks bro
In the last chapter, you told about Each and Every Controller. In this chapter, you are telling about Dashboard controller, all methods in that.
What about if we want to have for all the controllers and methods, barring two or three. E.g if we have 50 methods, we need it for 47, and dont need it for 3. Is there any method for that?
hello,
So, do we need to put all controller class name and method? Then for the large numbers of controllers and with each controller containing a large number of method, would be long lists.
Is it not possible just applied to controllers only, so that it will apply for each method of all controllers like in CI3 By extending MY_Controller or including the controller and extending to that controller. Or just including on __construct() method of each class in CI3.
we have 100s of functions how to add routs . we need to add filter in controller like dashboard only not every function . is there any solution
I have a question:
what if we write url direct controller with method (like: Dashboard/index)
In which file you want to add this Dashboard/index
Sir code is not working properly of this video in march 2023. Please guide me, I will always thankful to you if you help me. Thankyou
can we use a filter to hide navigation in the admin panel without applying sessions everywhere?
Ya, we can use filters to hide navigation
@@GoPHP How it can be implemented please guide me, I m working on a multi-login system. I want to show specific navigation to non-admin users by using filters
$routes->group('admin', ['filter'=>'isLoggedIn'], function($routes){
$routes->group('dashboard', function($routes){
$routes->add('/', 'Dashboard::index');
$routes->add('show', 'Dashboard::show');
});
});
I have created this admin routes group and the filter is not working on the admin routes group. When I use the filter in the dashboard group it works fine like this $routes->group('dashboard', ['filter'=>'isLoggedIn'], function($routes); please suggest solution
Agr mai controller ko hi restricted krna chahu to
Aapne jo method bataya usme bar bar hr method ka route banana padega aisa na krna pde pore controller m ek bar m ho jay iske liy kaise kre ??
In CI3, For page redirection, we have a method
redirect();
if we want to redirect all the controller methods, then we can write redirect() method in constructor function. this will woks
But In CI4, for page redirection, we have a method
return redirect()->to('/path');
constructor does not return any value.
So, return redirect()->to('/path'); this wont work in side constructor
for more info. please check the CodeIgniter forum link
forum.codeigniter.com/thread-74537.html
So, I think its better to restrict controllers access using routing in CI4
does codeigniter is fast