Yii Framework Forum: How to create application-scoped filter? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to create application-scoped filter? Rate Topic: -----

#1 User is offline   juhe 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 18-October 09

Posted 20 October 2009 - 03:46 PM

How to create application-scoped filter?

From documentation I can only find defining per controller in CController method filters().

For performance or logging purposes application scoped filters would be more interesting.
0

#2 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,016
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 21 October 2009 - 02:31 AM

You could use a BaseController class that all your controllers extend from and define the filters there. You just need to make sure, that controllers that use their own filter() method merge the return value of parent::filter().
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users