Skip to content

Commit

Permalink
Merge pull request #7934 from yosus/patch-15
Browse files Browse the repository at this point in the history
Update views.rst
  • Loading branch information
markstory authored Oct 22, 2024
2 parents 96b2354 + f86c63a commit 789becd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions en/views.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@ title, and sometimes assign the title as a view variable in the controller::
// In view file or layout above $this->fetch('title')
$this->assign('title', $title);

// Example where block contents are modified
$this->start('test_view_block');
echo 'default contents';
$this->end();
// Output : default contents
echo $this->fetch('test_view_block');
$this->assign('test_view_block', 'modified contents');
// Output : modified contents
echo $this->fetch('test_view_block');


The ``prepend()`` method allows you to prepend content to an existing block::

// Prepend to sidebar
Expand Down

0 comments on commit 789becd

Please sign in to comment.