Skip to content

Commit 789becd

Browse files
authored
Merge pull request #7934 from yosus/patch-15
Update views.rst
2 parents 96b2354 + f86c63a commit 789becd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

en/views.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,17 @@ title, and sometimes assign the title as a view variable in the controller::
308308
// In view file or layout above $this->fetch('title')
309309
$this->assign('title', $title);
310310

311+
// Example where block contents are modified
312+
$this->start('test_view_block');
313+
echo 'default contents';
314+
$this->end();
315+
// Output : default contents
316+
echo $this->fetch('test_view_block');
317+
$this->assign('test_view_block', 'modified contents');
318+
// Output : modified contents
319+
echo $this->fetch('test_view_block');
320+
321+
311322
The ``prepend()`` method allows you to prepend content to an existing block::
312323

313324
// Prepend to sidebar

0 commit comments

Comments
 (0)