Browse Source

Merge branch 'master' of github.com:cakephp/cakephp

Mark Story 10 years ago
parent
commit
7397ba3c59
2 changed files with 18 additions and 2 deletions
  1. 17 0
      src/View/View.php
  2. 1 2
      src/View/ViewBlock.php

+ 17 - 0
src/View/View.php

@@ -551,6 +551,23 @@ class View
     /**
      * 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()

+ 1 - 2
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;