From 72793db8a34727fe0024c0a3b644d0117fcab2aa Mon Sep 17 00:00:00 2001 From: Han Lin Yap Date: Sun, 18 Dec 2011 16:12:22 +0100 Subject: [PATCH] Fix bug - nesting Section. --- laravel/section.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/laravel/section.php b/laravel/section.php index df0431d8..dc8991c3 100644 --- a/laravel/section.php +++ b/laravel/section.php @@ -12,9 +12,9 @@ class Section { /** * 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. @@ -42,7 +42,7 @@ public static function start($section, $content = '') { ob_start(); - static::$last = $section; + static::$last[] = $section; } static::append($section, $content); @@ -74,7 +74,7 @@ public static function inject($section, $content) */ public static function stop() { - static::append(static::$last, ob_get_clean()); + static::append(array_pop(static::$last), ob_get_clean()); } /**