• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controller Filters - Input needed

#23
IMO, the filter should applied to controller and method directly. A bit different from @albertleao proposed.
PHP Code:
public $filter = [
    
'Blog' => ['add' => ['before' => ['isAdmin'], 'after' => ['somethingElse']],
           
'edit' => ['before' => ['isAdmin'], 'after' => ['somethingElse']],
           
'delete' => ['before' => ['isAdmin'], 'after' => ['somethingElse']],
           
'view' => ['before' => ['isLoggedIn'], 'after' => ['somethingElse']]
          ]
    ]; 
Keep calm.
Reply


Messages In This Thread
Controller Filters - Input needed - by kilishan - 07-07-2016, 08:39 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 06:46 AM
RE: Controller Filters - Input needed - by arma7x - 07-07-2016, 09:14 PM
RE: Controller Filters - Input needed - by arma7x - 07-10-2016, 11:42 PM
RE: Controller Filters - Input needed - by arma7x - 07-12-2016, 01:55 AM
RE: Controller Filters - Input needed - by arma7x - 07-13-2016, 12:23 AM
RE: Controller Filters - Input needed - by arma7x - 07-14-2016, 12:37 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.