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