Commit 72793db8 authored by Han Lin Yap's avatar Han Lin Yap

Fix bug - nesting Section.

parent ff5b6315
...@@ -12,9 +12,9 @@ class Section { ...@@ -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 @@ class Section { ...@@ -42,7 +42,7 @@ class Section {
{ {
ob_start(); ob_start();
static::$last = $section; static::$last[] = $section;
} }
static::append($section, $content); static::append($section, $content);
...@@ -74,7 +74,7 @@ class Section { ...@@ -74,7 +74,7 @@ class Section {
*/ */
public static function stop() public static function stop()
{ {
static::append(static::$last, ob_get_clean()); static::append(array_pop(static::$last), ob_get_clean());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment