@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @param mixed $v (default: null) The array of values exposed in template. |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
| 30 | - public static function render($t,$v=null){ |
|
| 30 | + public static function render($t, $v = null) { |
|
| 31 | 31 | if (Options::get('core.text.replace_empties', true)) { |
| 32 | 32 | $replacer = function($c) use ($v){ |
| 33 | 33 | return Object::fetch(trim($c[1]), $v); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | }; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - return preg_replace_callback("(\{\{([^}]+)\}\})S",$replacer,$t); |
|
| 41 | + return preg_replace_callback("(\{\{([^}]+)\}\})S", $replacer, $t); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * @param string $text The text to slugify |
| 54 | 54 | * @return string The slug. |
| 55 | 55 | */ |
| 56 | - public static function slugify($text){ |
|
| 56 | + public static function slugify($text) { |
|
| 57 | 57 | return preg_replace( |
| 58 | - ['(\s+)','([^a-z0-9-])i','(-+)'],['-','','-'], |
|
| 58 | + ['(\s+)', '([^a-z0-9-])i', '(-+)'], ['-', '', '-'], |
|
| 59 | 59 | strtolower(self::removeAccents($text))); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param string $text The text to translit |
| 72 | 72 | * @return string The translited text |
| 73 | 73 | */ |
| 74 | - public static function removeAccents($text){ |
|
| 74 | + public static function removeAccents($text) { |
|
| 75 | 75 | static $diac; |
| 76 | 76 | return strtr( |
| 77 | 77 | utf8_decode($text), |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | * @param mixed $v (default: null) The array of values exposed in template. |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
| 30 | - public static function render($t,$v=null){ |
|
| 30 | + public static function render($t,$v=null) { |
|
| 31 | 31 | if (Options::get('core.text.replace_empties', true)) { |
| 32 | - $replacer = function($c) use ($v){ |
|
| 32 | + $replacer = function($c) use ($v) { |
|
| 33 | 33 | return Object::fetch(trim($c[1]), $v); |
| 34 | 34 | }; |
| 35 | 35 | } else { |
| 36 | - $replacer = function($c) use ($v){ |
|
| 36 | + $replacer = function($c) use ($v) { |
|
| 37 | 37 | return Object::fetch(trim($c[1]), $v) ?: $c[0]; |
| 38 | 38 | }; |
| 39 | 39 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param string $text The text to slugify |
| 54 | 54 | * @return string The slug. |
| 55 | 55 | */ |
| 56 | - public static function slugify($text){ |
|
| 56 | + public static function slugify($text) { |
|
| 57 | 57 | return preg_replace( |
| 58 | 58 | ['(\s+)','([^a-z0-9-])i','(-+)'],['-','','-'], |
| 59 | 59 | strtolower(self::removeAccents($text))); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @param string $text The text to translit |
| 72 | 72 | * @return string The translited text |
| 73 | 73 | */ |
| 74 | - public static function removeAccents($text){ |
|
| 74 | + public static function removeAccents($text) { |
|
| 75 | 75 | static $diac; |
| 76 | 76 | return strtr( |
| 77 | 77 | utf8_decode($text), |