@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | public function __construct() { |
5 | 5 | parent::__construct(); |
6 | 6 | } |
7 | - public function init( $_page ) { |
|
7 | + public function init($_page) { |
|
8 | 8 | $this->tags = $_page->tags; |
9 | 9 | } |
10 | - public function draw( $_template ) { |
|
10 | + public function draw($_template) { |
|
11 | 11 | $page = ""; |
12 | - $extension = explode(".",$_template); |
|
13 | - $extension = $extension[count($extension)-1]; |
|
14 | - if($extension == "pug" || $extension == "jade") { |
|
12 | + $extension = explode(".", $_template); |
|
13 | + $extension = $extension[count($extension) - 1]; |
|
14 | + if ($extension == "pug" || $extension == "jade") { |
|
15 | 15 | $pug = new Pug\Pug(); |
16 | 16 | $page = $pug->render($_template); |
17 | 17 | } else |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $render = $this->overlayTag($page); |
20 | 20 | echo minifyOutput($render); |
21 | 21 | } |
22 | - protected function overlayTag( $_page ) { |
|
23 | - foreach($this->tags as $key => $value) |
|
24 | - if(!is_array($value)) |
|
22 | + protected function overlayTag($_page) { |
|
23 | + foreach ($this->tags as $key => $value) |
|
24 | + if (!is_array($value)) |
|
25 | 25 | $_page = str_replace("<_${key}_>", "$value", $_page); |
26 | 26 | return $_page; |
27 | 27 | } |
@@ -14,15 +14,17 @@ |
||
14 | 14 | if($extension == "pug" || $extension == "jade") { |
15 | 15 | $pug = new Pug\Pug(); |
16 | 16 | $page = $pug->render($_template); |
17 | - } else |
|
18 | - $page = file_get_contents($_template); |
|
17 | + } else { |
|
18 | + $page = file_get_contents($_template); |
|
19 | + } |
|
19 | 20 | $render = $this->overlayTag($page); |
20 | 21 | echo minifyOutput($render); |
21 | 22 | } |
22 | 23 | protected function overlayTag( $_page ) { |
23 | - foreach($this->tags as $key => $value) |
|
24 | - if(!is_array($value)) |
|
24 | + foreach($this->tags as $key => $value) { |
|
25 | + if(!is_array($value)) |
|
25 | 26 | $_page = str_replace("<_${key}_>", "$value", $_page); |
27 | + } |
|
26 | 28 | return $_page; |
27 | 29 | } |
28 | 30 | } |