@@ -34,8 +34,9 @@ |
||
34 | 34 | */ |
35 | 35 | public static function mkdir($path) |
36 | 36 | { |
37 | - if (file_exists($path) || @mkdir($path)) |
|
38 | - return TRUE; |
|
37 | + if (file_exists($path) || @mkdir($path)) { |
|
38 | + return TRUE; |
|
39 | + } |
|
39 | 40 | return (self::mkdir(dirname($path)) && mkdir($path)); |
40 | 41 | } |
41 | 42 |
@@ -136,8 +136,9 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public static function getPath() |
138 | 138 | { |
139 | - if (self::$_response) |
|
140 | - return self::$_path . self::$_view . '.' . self::$_response . '.phtml'; |
|
139 | + if (self::$_response) { |
|
140 | + return self::$_path . self::$_view . '.' . self::$_response . '.phtml'; |
|
141 | + } |
|
141 | 142 | |
142 | 143 | return self::$_path . self::$_view . '.phtml'; |
143 | 144 | } |
@@ -224,8 +225,9 @@ discard block |
||
224 | 225 | */ |
225 | 226 | public static function render(Controller $controller) |
226 | 227 | { |
227 | - if (!self::$_view && !self::$_template) |
|
228 | - return ob_end_flush(); |
|
228 | + if (!self::$_view && !self::$_template) { |
|
229 | + return ob_end_flush(); |
|
230 | + } |
|
229 | 231 | |
230 | 232 | // Guarda el controlador |
231 | 233 | self::$_controller = $controller; |
@@ -253,8 +255,9 @@ discard block |
||
253 | 255 | ob_start(); |
254 | 256 | |
255 | 257 | // carga la vista |
256 | - if (!include self::getView()) |
|
257 | - throw new KumbiaException('Vista "' . self::getPath() . '" no encontrada', 'no_view'); |
|
258 | + if (!include self::getView()) { |
|
259 | + throw new KumbiaException('Vista "' . self::getPath() . '" no encontrada', 'no_view'); |
|
260 | + } |
|
258 | 261 | |
259 | 262 | // si esta en produccion y se cachea la vista |
260 | 263 | self::saveCache('view'); |
@@ -274,8 +277,9 @@ discard block |
||
274 | 277 | ob_start(); |
275 | 278 | |
276 | 279 | // carga el template |
277 | - if (!include APP_PATH . "views/_shared/templates/$__template.phtml") |
|
278 | - throw new KumbiaException("Template $__template no encontrado"); |
|
280 | + if (!include APP_PATH . "views/_shared/templates/$__template.phtml") { |
|
281 | + throw new KumbiaException("Template $__template no encontrado"); |
|
282 | + } |
|
279 | 283 | |
280 | 284 | // si esta en produccion y se cachea template |
281 | 285 | self::saveCache('template'); |
@@ -351,7 +355,9 @@ discard block |
||
351 | 355 | */ |
352 | 356 | public static function getVar($var = '') |
353 | 357 | { |
354 | - if(!$var) return get_object_vars(self::$_controller); |
|
358 | + if(!$var) { |
|
359 | + return get_object_vars(self::$_controller); |
|
360 | + } |
|
355 | 361 | |
356 | 362 | return isset(self::$_controller->$var) ? self::$_controller->$var : NULL; |
357 | 363 | } |
@@ -94,7 +94,9 @@ |
||
94 | 94 | foreach ($args as $model) { |
95 | 95 | $Model = Util::camelcase(basename($model)); |
96 | 96 | //Si esta cargada continua con la siguiente clase |
97 | - if (class_exists($Model, FALSE)) continue; |
|
97 | + if (class_exists($Model, FALSE)) { |
|
98 | + continue; |
|
99 | + } |
|
98 | 100 | if (!include APP_PATH . "models/$model.php") { |
99 | 101 | throw new KumbiaException($model,'no_model'); |
100 | 102 | } |
@@ -120,7 +120,9 @@ |
||
120 | 120 | public static function add( $file, $dependencies=array() ) |
121 | 121 | { |
122 | 122 | self::$_js[$file] = $file; |
123 | - foreach ($dependencies as $file) self::$_dependencies[$file] = $file; |
|
123 | + foreach ($dependencies as $file) { |
|
124 | + self::$_dependencies[$file] = $file; |
|
125 | + } |
|
124 | 126 | } |
125 | 127 | |
126 | 128 | /** |
@@ -34,8 +34,9 @@ discard block |
||
34 | 34 | { |
35 | 35 | |
36 | 36 | $model_name = Util::smallcase(get_class($model)); |
37 | - if (!$action) |
|
38 | - $action = ltrim(Router::get('route'), '/'); |
|
37 | + if (!$action) { |
|
38 | + $action = ltrim(Router::get('route'), '/'); |
|
39 | + } |
|
39 | 40 | |
40 | 41 | echo '<form action="', PUBLIC_PATH . $action, '" method="post" id="', $model_name, '" class="scaffold">' , PHP_EOL; |
41 | 42 | $pk = $model->primary_key[0]; |
@@ -52,8 +53,9 @@ discard block |
||
52 | 53 | |
53 | 54 | if (in_array($field, $model->not_null)) { |
54 | 55 | echo "<label for=\"$formId\" class=\"required\">$alias *</label>" , PHP_EOL; |
55 | - } else |
|
56 | - echo "<label for=\"$formId\">$alias</label>" , PHP_EOL; |
|
56 | + } else { |
|
57 | + echo "<label for=\"$formId\">$alias</label>" , PHP_EOL; |
|
58 | + } |
|
57 | 59 | |
58 | 60 | switch ($tipo) { |
59 | 61 | case 'tinyint': case 'smallint': case 'mediumint': |
@@ -85,8 +87,9 @@ discard block |
||
85 | 87 | case 'enum': case 'set': case 'bool': |
86 | 88 | $enumList = explode(",", str_replace("'", "", substr($model->_data_type[$field], 5, (strlen($model->_data_type[$field])-6)))); |
87 | 89 | echo "<select id=\"$formId\" class=\"select\" name=\"$formName\" >", PHP_EOL; |
88 | - foreach($enumList as $value) |
|
89 | - echo "<option value=\"{$value}\">$value</option>", PHP_EOL; |
|
90 | + foreach($enumList as $value) { |
|
91 | + echo "<option value=\"{$value}\">$value</option>", PHP_EOL; |
|
92 | + } |
|
90 | 93 | echo '</select>', PHP_EOL; |
91 | 94 | break; |
92 | 95 |
@@ -42,7 +42,9 @@ |
||
42 | 42 | */ |
43 | 43 | public static function getAttrs($params) |
44 | 44 | { |
45 | - if(!is_array($params))return (string)$params; |
|
45 | + if(!is_array($params)) { |
|
46 | + return (string)$params; |
|
47 | + } |
|
46 | 48 | $data = ''; |
47 | 49 | foreach ($params as $k => $v) { |
48 | 50 | $data .= " $k=\"$v\""; |
@@ -56,7 +56,9 @@ |
||
56 | 56 | public static function add( $file, array $dependencies = [] ) |
57 | 57 | { |
58 | 58 | self::$_css[$file] = $file; |
59 | - foreach ($dependencies as $file) self::$_dependencies [$file] = $file; |
|
59 | + foreach ($dependencies as $file) { |
|
60 | + self::$_dependencies [$file] = $file; |
|
61 | + } |
|
60 | 62 | } |
61 | 63 | |
62 | 64 | /** |