Merge pull request #211 from codler/patch-3

Fix bug - nesting Section.
This commit is contained in:
Taylor Otwell 2011-12-18 12:09:00 -08:00
commit 9d7534fa70
1 changed files with 4 additions and 4 deletions

View File

@ -12,9 +12,9 @@ class Section {
/** /**
* The last section on which injection was started. * The last section on which injection was started.
* *
* @var string * @var array
*/ */
protected static $last; protected static $last = array();
/** /**
* Start injecting content into a section. * Start injecting content into a section.
@ -42,7 +42,7 @@ public static function start($section, $content = '')
{ {
ob_start(); ob_start();
static::$last = $section; static::$last[] = $section;
} }
static::append($section, $content); static::append($section, $content);
@ -74,7 +74,7 @@ public static function inject($section, $content)
*/ */
public static function stop() public static function stop()
{ {
static::append(static::$last, ob_get_clean()); static::append(array_pop(static::$last), ob_get_clean());
} }
/** /**