Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
b836665d
Commit
b836665d
authored
May 08, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added beginPage and endPage events.
parent
6b770dad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
View.php
framework/base/View.php
+12
-0
No files found.
framework/base/View.php
View file @
b836665d
...
...
@@ -23,6 +23,14 @@ use yii\helpers\Html;
class
View
extends
Component
{
/**
* @event ViewEvent an event that is triggered by [[beginPage()]].
*/
const
EVENT_BEGIN_PAGE
=
'beginPage'
;
/**
* @event ViewEvent an event that is triggered by [[endPage()]].
*/
const
EVENT_END_PAGE
=
'endPage'
;
/**
* @event ViewEvent an event that is triggered by [[renderFile()]] right before it renders a view file.
*/
const
EVENT_BEFORE_RENDER
=
'beforeRender'
;
...
...
@@ -555,6 +563,8 @@ class View extends Component
{
ob_start
();
ob_implicit_flush
(
false
);
$this
->
trigger
(
self
::
EVENT_BEGIN_PAGE
);
}
/**
...
...
@@ -562,6 +572,8 @@ class View extends Component
*/
public
function
endPage
()
{
$this
->
trigger
(
self
::
EVENT_END_PAGE
);
$content
=
ob_get_clean
();
echo
strtr
(
$content
,
array
(
self
::
PL_HEAD
=>
$this
->
renderHeadHtml
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment