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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
c6ecf4f2
Commit
c6ecf4f2
authored
Nov 20, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed public property naming.
parent
fb945866
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Widget.php
framework/yii/base/Widget.php
+6
-6
No files found.
framework/yii/base/Widget.php
View file @
c6ecf4f2
...
@@ -27,13 +27,13 @@ class Widget extends Component implements ViewContextInterface
...
@@ -27,13 +27,13 @@ class Widget extends Component implements ViewContextInterface
* @var integer a counter used to generate [[id]] for widgets.
* @var integer a counter used to generate [[id]] for widgets.
* @internal
* @internal
*/
*/
public
static
$
_
counter
=
0
;
public
static
$counter
=
0
;
/**
/**
* @var Widget[] the widgets that are currently being rendered (not ended). This property
* @var Widget[] the widgets that are currently being rendered (not ended). This property
* is maintained by [[begin()]] and [[end()]] methods.
* is maintained by [[begin()]] and [[end()]] methods.
* @internal
* @internal
*/
*/
public
static
$
_
stack
=
[];
public
static
$stack
=
[];
/**
/**
...
@@ -48,7 +48,7 @@ class Widget extends Component implements ViewContextInterface
...
@@ -48,7 +48,7 @@ class Widget extends Component implements ViewContextInterface
$config
[
'class'
]
=
get_called_class
();
$config
[
'class'
]
=
get_called_class
();
/** @var Widget $widget */
/** @var Widget $widget */
$widget
=
Yii
::
createObject
(
$config
);
$widget
=
Yii
::
createObject
(
$config
);
self
::
$
_
stack
[]
=
$widget
;
self
::
$stack
[]
=
$widget
;
return
$widget
;
return
$widget
;
}
}
...
@@ -60,8 +60,8 @@ class Widget extends Component implements ViewContextInterface
...
@@ -60,8 +60,8 @@ class Widget extends Component implements ViewContextInterface
*/
*/
public
static
function
end
()
public
static
function
end
()
{
{
if
(
!
empty
(
self
::
$
_
stack
))
{
if
(
!
empty
(
self
::
$stack
))
{
$widget
=
array_pop
(
self
::
$
_
stack
);
$widget
=
array_pop
(
self
::
$stack
);
if
(
get_class
(
$widget
)
===
get_called_class
())
{
if
(
get_class
(
$widget
)
===
get_called_class
())
{
$widget
->
run
();
$widget
->
run
();
return
$widget
;
return
$widget
;
...
@@ -100,7 +100,7 @@ class Widget extends Component implements ViewContextInterface
...
@@ -100,7 +100,7 @@ class Widget extends Component implements ViewContextInterface
public
function
getId
(
$autoGenerate
=
true
)
public
function
getId
(
$autoGenerate
=
true
)
{
{
if
(
$autoGenerate
&&
$this
->
_id
===
null
)
{
if
(
$autoGenerate
&&
$this
->
_id
===
null
)
{
$this
->
_id
=
'w'
.
self
::
$
_
counter
++
;
$this
->
_id
=
'w'
.
self
::
$counter
++
;
}
}
return
$this
->
_id
;
return
$this
->
_id
;
}
}
...
...
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