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
5a8672a1
Commit
5a8672a1
authored
May 30, 2014
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs about nested layouts added
parent
f19a97e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
structure-views.md
docs/guide/structure-views.md
+12
-1
No files found.
docs/guide/structure-views.md
View file @
5a8672a1
...
...
@@ -330,7 +330,7 @@ are triggering page rendering events that are used for registering scripts, link
Always include these in your layout in order for the rendering to work correctly.
By default layout is loaded from `views/layouts/main.php`. You may change it at controller or module level by setting
different value to `layout` propery.
different value to `layout` proper
t
y.
In order to pass data from controller to layout, that you may need for breadcrumbs or similar elements, use view component
params property. In controller it can be set as:
...
...
@@ -353,6 +353,17 @@ In layout file the value can be used like the following:
]) ?>
```
You may also wrap the view render result into a layout using [[yii\base\View::beginContent()]], [[yii\base\View::endContent()]].
This approach can be used while applying nested layouts:
```
php
<
?
php
$
this-
>
beginContent('//layouts/overall') ?>
<div
class=
"content"
>
<?= $content ?>
<div>
<
?
php
$
this-
>
endContent() ?>
```
### Partials
Often you need to reuse some HTML markup in many views and often it's too simple to create a full-featured widget for it.
...
...
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