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
8d5d4384
Commit
8d5d4384
authored
Nov 20, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6119 from cdvrooman/patch-3
[ci skip] Update structure-widgets.md
parents
5526cad1
9d53fdc5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
structure-widgets.md
docs/guide/structure-widgets.md
+3
-3
No files found.
docs/guide/structure-widgets.md
View file @
8d5d4384
...
...
@@ -24,7 +24,7 @@ if you want to learn about the usage of a particular widget.
Widgets are primarily used in
[
views
](
structure-views.md
)
. You can call the
[
[yii\base\Widget::widget()
]
] method
to use a widget in a view. The method takes a
[
configuration
](
concept-configurations.md
)
array for initializing
the widget and returns the rendering result of the widget. For example, the following code inserts a date picker
widget which is configured to use Russian language and keep the input in the
`from_date`
attribute of
`$model`
.
widget which is configured to use
the
Russian language and keep the input in the
`from_date`
attribute of
`$model`
.
```
php
<?php
...
...
@@ -138,7 +138,7 @@ class HelloWidget extends Widget
}
```
As you can see, PHP output buffer is started in
`init()`
so that any output between the calls of
`init()`
and
`run()`
As you can see, PHP
's
output buffer is started in
`init()`
so that any output between the calls of
`init()`
and
`run()`
can be captured, processed and returned in
`run()`
.
> Info: When you call [[yii\base\Widget::begin()]], a new instance of the widget will be created and the `init()` method
...
...
@@ -189,4 +189,4 @@ which can be utilized to solve the problem.
When a widget contains view code only, it is very similar to a
[
view
](
structure-views.md
)
. In fact, in this case,
their only difference is that a widget is a redistributable class, while a view is just a plain PHP script
that you would prefer to keep
it
within your application.
that you would prefer to keep within your application.
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