From c5d382c68a41641ab7c9c7651495e5991788a489 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 11 May 2013 16:24:44 +0200 Subject: [PATCH] added newline to end of header and body blocks in View issue #237 --- yii/base/View.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yii/base/View.php b/yii/base/View.php index f1a9a0f..84a6f11 100644 --- a/yii/base/View.php +++ b/yii/base/View.php @@ -771,7 +771,7 @@ class View extends Component if (!empty($this->js[self::POS_HEAD])) { $lines[] = implode("\n", $this->js[self::POS_HEAD]); } - return implode("\n", $lines); + return empty($lines) ? '' : implode("\n", $lines) . "\n"; } /** @@ -788,7 +788,7 @@ class View extends Component if (!empty($this->js[self::POS_BEGIN])) { $lines[] = implode("\n", $this->js[self::POS_BEGIN]); } - return implode("\n", $lines); + return empty($lines) ? '' : implode("\n", $lines) . "\n"; } /** @@ -805,6 +805,6 @@ class View extends Component if (!empty($this->js[self::POS_END])) { $lines[] = implode("\n", $this->js[self::POS_END]); } - return implode("\n", $lines); + return empty($lines) ? '' : implode("\n", $lines) . "\n"; } }