#46 isLoggedIn Filter | Controller Filters | CodeIgniter 4 Tutorials

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

Комментарии • 16

  • @ksangeetha7530
    @ksangeetha7530 3 года назад

    Thank you sir, your tutorial is just awesome, interesting and easy to get sir

    • @GoPHP
      @GoPHP  3 года назад

      Thank You

  • @paypay7271
    @paypay7271 2 года назад

    thanks bro

  • @vijaysrini27
    @vijaysrini27 3 года назад +1

    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?

  • @softwareEngineerKunwar
    @softwareEngineerKunwar 3 года назад

    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.

  • @karthiktranquil7919
    @karthiktranquil7919 Год назад

    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

  • @prashantkushwah694
    @prashantkushwah694 3 года назад

    I have a question:
    what if we write url direct controller with method (like: Dashboard/index)

    • @GoPHP
      @GoPHP  3 года назад

      In which file you want to add this Dashboard/index

  • @LalitKumar-hg7yo
    @LalitKumar-hg7yo Год назад

    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

  • @mansoorahmad1515
    @mansoorahmad1515 4 года назад

    can we use a filter to hide navigation in the admin panel without applying sessions everywhere?

    • @GoPHP
      @GoPHP  4 года назад

      Ya, we can use filters to hide navigation

    • @mansoorahmad1515
      @mansoorahmad1515 4 года назад

      @@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

    • @mansoorahmad1515
      @mansoorahmad1515 4 года назад

      $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

  • @mutech8024
    @mutech8024 4 года назад

    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 ??

    • @GoPHP
      @GoPHP  4 года назад

      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

  • @udyogainfo2645
    @udyogainfo2645 3 года назад +1

    does codeigniter is fast