diff --git a/src/View/View.php b/src/View/View.php index 43022bea0b8..a1cf32ad29f 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -551,6 +551,23 @@ public function blocks() /** * Start capturing output for a 'block' * + * You can use start on a block multiple times to + * append or prepend content in a capture mode. + * + * ``` + * // Append content to an existing block. + * $this->start('content'); + * echo $this->fetch('content'); + * echo 'Some new content'; + * $this->end(); + * + * // Prepend content to an existing block + * $this->start('content'); + * echo 'Some new content'; + * echo $this->fetch('content'); + * $this->end(); + * ``` + * * @param string $name The name of the block to capture for. * @return void * @see ViewBlock::start() diff --git a/src/View/ViewBlock.php b/src/View/ViewBlock.php index a490da32583..ebf05d53e91 100644 --- a/src/View/ViewBlock.php +++ b/src/View/ViewBlock.php @@ -57,9 +57,8 @@ class ViewBlock /** * Should the currently captured content be discarded on ViewBlock::end() * - * @var bool * @see ViewBlock::end() - * @see ViewBlock::startIfEmpty() + * @var bool */ protected $_discardActiveBufferOnEnd = false;