@@ -5,13 +5,13 @@ |
||
5 | 5 | public function __construct() { |
6 | 6 | parent::__construct(); |
7 | 7 | } |
8 | - public function drawFile( $_file, $_parameters = [] ) { |
|
8 | + public function drawFile($_file, $_parameters = []) { |
|
9 | 9 | return $this->draw($_file, $_parameters); |
10 | 10 | } |
11 | - public function drawText( $_text, $_parameters = [] ) { |
|
11 | + public function drawText($_text, $_parameters = []) { |
|
12 | 12 | return $this->draw(trim($_text), $_parameters); |
13 | 13 | } |
14 | - public function draw( $_text, $_parameters = [] ) { |
|
14 | + public function draw($_text, $_parameters = []) { |
|
15 | 15 | $pug = new Pug\Pug(); |
16 | 16 | $page = $pug->render($_text, $_parameters); |
17 | 17 | return $page; |
@@ -5,28 +5,28 @@ discard block |
||
5 | 5 | return ob_start(); |
6 | 6 | } |
7 | 7 | |
8 | - function jBlockClose( $_type = "html", $_parameters = [] ) { |
|
8 | + function jBlockClose($_type = "html", $_parameters = []) { |
|
9 | 9 | return jBlockEnd($_type, $_parameters); |
10 | 10 | } |
11 | 11 | |
12 | - function jBlockFile( $_path, $_parameters = [] ) { |
|
12 | + function jBlockFile($_path, $_parameters = []) { |
|
13 | 13 | $extension = explode(".", $_path); |
14 | - $extension = $extension[count($extension)-1]; |
|
14 | + $extension = $extension[count($extension) - 1]; |
|
15 | 15 | $extension = strtolower($extension); |
16 | 16 | return jBlockFileMan($_path, $extension, $_parameters); |
17 | 17 | } |
18 | 18 | |
19 | - function jBlockFileMan( $_path, $_type, $_parameters = [] ) { |
|
19 | + function jBlockFileMan($_path, $_type, $_parameters = []) { |
|
20 | 20 | $temp = file_get_contents($_path); |
21 | 21 | return jBlockParsing($_type, $temp, $_parameters); |
22 | 22 | } |
23 | 23 | |
24 | - function jBlockEnd( $_type = "html", $_parameters = [] ) { |
|
24 | + function jBlockEnd($_type = "html", $_parameters = []) { |
|
25 | 25 | $text = ob_get_clean(); |
26 | 26 | return jBlockParsing($_type, $text, $_parameters); |
27 | 27 | } |
28 | 28 | |
29 | - function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) { |
|
29 | + function jBlockParsing($_type = "html", $_string = "", $_parameters = []) { |
|
30 | 30 | switch ($_type) { |
31 | 31 | case "pug": |
32 | 32 | case "jade": |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | function minifyOutput($_buffer) { |
52 | - $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
|
53 | - $replace = array ( '>', '<', '\\1' ); |
|
54 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
52 | + $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'); |
|
53 | + $replace = array('>', '<', '\\1'); |
|
54 | + if (preg_match("/\<html/i", $_buffer) == 1 && preg_match("/\<\/html\>/i", $_buffer) == 1) |
|
55 | 55 | $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
56 | 56 | return utf8_encode($_buffer); |
57 | 57 | } |