Guest User

Untitled

a guest
Nov 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. controller:
  2.  
  3. public function filtes()
  4. {
  5.     return array(
  6.         'accessControl',
  7.         'application.components.UserFilter',
  8.     );
  9. }
  10.  
  11. public function actionIndex()
  12. {
  13.     var_dump($this->filters()); // empty array
  14. }
  15.  
  16. UserFilter:
  17.  
  18. class UserFilter extends CFilter
  19. {
  20.     public function init()
  21.     {
  22.         echo "init test";
  23.     }
  24.    
  25.     public function preFilter($filterChain)
  26.     {
  27.         echo "filter test";
  28.        
  29.         return true;
  30.     }
  31. }
Add Comment
Please, Sign In to add comment