yiisoft / view

Yii view rendering library
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
55 stars 43 forks source link

Remake events #150

Closed vjik closed 3 years ago

vjik commented 3 years ago
Q A
Is bugfix?
New feature? ✔️
Breaks BC? ✔️
Fixed issues #79 #43
samdark commented 3 years ago

What problem each of these changes solve?

vjik commented 3 years ago

Add event Head: https://github.com/yiisoft/view/issues/43

Pass context object (View of WebView) to all events: https://github.com/yiisoft/view/issues/79

Split events to View events and WebView events: events has different data (View or WebView). When events splitted we have right types.

Pass parameters to all events: BeforeRender and AfterRender use parameters of view, rest events use parameters passed to mark methods (beginPage(), beginBody() and other): In BeforeRender and AfterRender we have all parameters from view, in rest events we don't have parameters (this fire from view template) and can only send parameters to mark functions (beginPage(), beginBody() and other).