@@ -3,7 +3,8 @@ discard block |
||
| 3 | 3 | use System\Application; |
| 4 | 4 | |
| 5 | 5 | if (!function_exists('pre')) { |
| 6 | - function pre($var) { |
|
| 6 | + function pre($var) |
|
| 7 | + { |
|
| 7 | 8 | echo '<pre>'; |
| 8 | 9 | print_r($var); |
| 9 | 10 | echo '</pre>'; |
@@ -40,7 +41,8 @@ discard block |
||
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | if (!function_exists('url')) { |
| 43 | - function url($path) { |
|
| 44 | + function url($path) |
|
| 45 | + { |
|
| 44 | 46 | $app = Application::getInstance(); |
| 45 | 47 | return $app->url->link($path); |
| 46 | 48 | } |
@@ -55,19 +57,22 @@ discard block |
||
| 55 | 57 | } |
| 56 | 58 | |
| 57 | 59 | if (!function_exists('remove_space')) { |
| 58 | - function remove_space($str) { |
|
| 60 | + function remove_space($str) |
|
| 61 | + { |
|
| 59 | 62 | return str_replace(' ', '-', $str); |
| 60 | 63 | } |
| 61 | 64 | } |
| 62 | 65 | |
| 63 | 66 | if (!function_exists('remove_dash')) { |
| 64 | - function remove_dash($str) { |
|
| 67 | + function remove_dash($str) |
|
| 68 | + { |
|
| 65 | 69 | return str_replace('-', ' ', $str); |
| 66 | 70 | } |
| 67 | 71 | } |
| 68 | 72 | |
| 69 | 73 | if (!function_exists('clean_name_url')) { |
| 70 | - function clean_name_url($class = null) { |
|
| 74 | + function clean_name_url($class = null) |
|
| 75 | + { |
|
| 71 | 76 | |
| 72 | 77 | $app = Application::getInstance(); |
| 73 | 78 | |
@@ -97,7 +102,8 @@ discard block |
||
| 97 | 102 | } |
| 98 | 103 | |
| 99 | 104 | if (!function_exists('text_char_limit')) { |
| 100 | - function text_char_limit($text, $limit) { |
|
| 105 | + function text_char_limit($text, $limit) |
|
| 106 | + { |
|
| 101 | 107 | if (strlen($text) > $limit) { |
| 102 | 108 | return substr($text, 0, $limit) . '...'; |
| 103 | 109 | } |
@@ -105,7 +111,8 @@ discard block |
||
| 105 | 111 | } |
| 106 | 112 | |
| 107 | 113 | if (!function_exists('array_equal')) { |
| 108 | - function array_equal($a, $b) { |
|
| 114 | + function array_equal($a, $b) |
|
| 115 | + { |
|
| 109 | 116 | return ( |
| 110 | 117 | is_array($a) |
| 111 | 118 | && is_array($b) |
@@ -116,7 +123,8 @@ discard block |
||
| 116 | 123 | } |
| 117 | 124 | |
| 118 | 125 | if (!function_exists('redirect_after')) { |
| 119 | - function redirect_after($num) { |
|
| 126 | + function redirect_after($num) |
|
| 127 | + { |
|
| 120 | 128 | $app = Application::getInstance(); |
| 121 | 129 | $app->url->redirectTo('/', $num); |
| 122 | 130 | } |