Yii Framework Forum: Yii2: More Events In Controller - Yii Framework Forum

Jump to content

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

Yii2: More Events In Controller Rate Topic: -----

#1 User is offline   ehm Plankje? 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 27-September 13

Posted 09 June 2014 - 10:34 AM

I was working on a Behavior for which I had to listen to the Controller::render() method to be called. Even more, I had to distinguish between the type of render method called. Unfortunately, the Controller class only offers two events: EVENT_BEFORE_ACTION and EVENT_AFTER_ACTION. It would be nice if this list at least were extended with:

- EVENT_BEFORE_RENDER
- EVENT_BEFORE_RENDER_FILE
- EVENT_BEFORE_RENDER_PARTIAL
- EVENT_BEFORE_RENDER_AJAX
- EVENT_AFTER_RENDER
- EVENT_AFTER_RENDER_FILE
- EVENT_AFTER_RENDER_PARTIAL
- EVENT_AFTER_RENDER_AJAX

I know it is not likely new features will be added to current 2.0.0beta, but this is a minor adjustment with no disadvantages or compatibility issues. It would help me greatly, because I don't want my components to extend from custom components, but I prefer the default components instead. :)

If anyone else is missing events, feel free to complement my list.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,346
  • Joined: 17-January 09
  • Location:Russia

Posted 17 June 2014 - 06:10 AM

There are additional events in \yii\base\View and \yii\web\View.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
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