From 9824aea9783bcdafb9a8d8034ab6b46b53fb11c6 Mon Sep 17 00:00:00 2001 From: Joan Mon Date: Fri, 21 Aug 2015 20:22:28 +0200 Subject: [PATCH] Var names refactor --- src/TplEngine/View.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/TplEngine/View.php b/src/TplEngine/View.php index 133a96f..dbbdbfc 100644 --- a/src/TplEngine/View.php +++ b/src/TplEngine/View.php @@ -11,11 +11,11 @@ class View /** * @var array */ - private static $extend = []; + private static $templateHeap = []; /** * @var string */ - private static $content = ''; + private static $contentToRender = ''; /** * @var array */ @@ -36,7 +36,7 @@ public static function setBasePath($basePath) */ public static function templateExtend($template) { - array_push(self::$extend, $template); + array_push(self::$templateHeap, $template); } /** @@ -47,14 +47,12 @@ public static function templateExtend($template) */ public static function render($template) { - $text = self::requireIntoString($template); - - while (!empty(self::$extend)) { - self::$content = $text; - $text = self::requireIntoString(array_pop(self::$extend)); + $templateContent = self::requireIntoString($template); + while (!empty(self::$templateHeap)) { + self::$contentToRender = $templateContent; + $templateContent = self::requireIntoString(array_pop(self::$templateHeap)); } - - return $text; + return $templateContent; } /** @@ -62,7 +60,7 @@ public static function render($template) */ public static function content() { - echo self::$content; + echo self::$contentToRender; } /**