@@ -193,8 +193,8 @@ discard block |
||
| 193 | 193 | { |
| 194 | 194 | foreach ($params as $param => $value) |
| 195 | 195 | { |
| 196 | - if (property_exists(__CLASS__, strtolower($param)) && method_exists($this, 'set'.$param)) |
|
| 197 | - $this->{'set'.$param}($value); |
|
| 196 | + if (property_exists(__CLASS__, strtolower($param)) && method_exists($this, 'set' . $param)) |
|
| 197 | + $this->{'set' . $param}($value); |
|
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
@@ -218,11 +218,11 @@ discard block |
||
| 218 | 218 | $view = ""; |
| 219 | 219 | |
| 220 | 220 | if (!is_null($controller->getModule())) |
| 221 | - $view .= $controller->getModule()->getModulePath() .'/'. $controller->getModule()->getModuleName() .'/'; |
|
| 221 | + $view .= $controller->getModule()->getModulePath() . '/' . $controller->getModule()->getModuleName() . '/'; |
|
| 222 | 222 | |
| 223 | 223 | $view .= |
| 224 | - $controller->getModule()->getViewPath() .'/'. |
|
| 225 | - basename(str_replace('\\','/',get_class($controller))) .'/'. |
|
| 224 | + $controller->getModule()->getViewPath() . '/' . |
|
| 225 | + basename(str_replace('\\', '/', get_class($controller))) . '/' . |
|
| 226 | 226 | $controller->getMethod() . '.phtml'; |
| 227 | 227 | |
| 228 | 228 | $this->view = $view; |
@@ -162,8 +162,9 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | $config = $module->getConfig(); |
| 164 | 164 | |
| 165 | - if (!array_key_exists($view, $config["view_manager"]["view_map"]) || !file_exists($config["view_manager"]["view_map"][$view])) |
|
| 166 | - throw new Exception\ViewNotFoundException("The 'view' template " . $view . " does not exists"); |
|
| 165 | + if (!array_key_exists($view, $config["view_manager"]["view_map"]) || !file_exists($config["view_manager"]["view_map"][$view])) { |
|
| 166 | + throw new Exception\ViewNotFoundException("The 'view' template " . $view . " does not exists"); |
|
| 167 | + } |
|
| 167 | 168 | |
| 168 | 169 | $this->view = $config["view_manager"]["view_map"][$view]; |
| 169 | 170 | } |
@@ -193,8 +194,9 @@ discard block |
||
| 193 | 194 | { |
| 194 | 195 | foreach ($params as $param => $value) |
| 195 | 196 | { |
| 196 | - if (property_exists(__CLASS__, strtolower($param)) && method_exists($this, 'set'.$param)) |
|
| 197 | - $this->{'set'.$param}($value); |
|
| 197 | + if (property_exists(__CLASS__, strtolower($param)) && method_exists($this, 'set'.$param)) { |
|
| 198 | + $this->{'set'.$param}($value); |
|
| 199 | + } |
|
| 198 | 200 | } |
| 199 | 201 | } |
| 200 | 202 | |
@@ -217,8 +219,9 @@ discard block |
||
| 217 | 219 | { |
| 218 | 220 | $view = ""; |
| 219 | 221 | |
| 220 | - if (!is_null($controller->getModule())) |
|
| 221 | - $view .= $controller->getModule()->getModulePath() .'/'. $controller->getModule()->getModuleName() .'/'; |
|
| 222 | + if (!is_null($controller->getModule())) { |
|
| 223 | + $view .= $controller->getModule()->getModulePath() .'/'. $controller->getModule()->getModuleName() .'/'; |
|
| 224 | + } |
|
| 222 | 225 | |
| 223 | 226 | $view .= |
| 224 | 227 | $controller->getModule()->getViewPath() .'/'. |
@@ -230,25 +233,28 @@ discard block |
||
| 230 | 233 | |
| 231 | 234 | if ($controller->getTerminal()) |
| 232 | 235 | { |
| 233 | - if (file_exists($view)) |
|
| 234 | - include $view; |
|
| 235 | - } |
|
| 236 | - else |
|
| 236 | + if (file_exists($view)) { |
|
| 237 | + include $view; |
|
| 238 | + } |
|
| 239 | + } else |
|
| 237 | 240 | { |
| 238 | - if (!is_null($this->view) && !file_exists($this->view)) |
|
| 239 | - throw new Exception\ViewNotFoundException("The 'view' template " . $this->view . " does not exists"); |
|
| 241 | + if (!is_null($this->view) && !file_exists($this->view)) { |
|
| 242 | + throw new Exception\ViewNotFoundException("The 'view' template " . $this->view . " does not exists"); |
|
| 243 | + } |
|
| 240 | 244 | |
| 241 | 245 | $config = $controller->getModule()->getConfig(); |
| 242 | 246 | |
| 243 | 247 | $layout = $controller->getLayout(); |
| 244 | 248 | |
| 245 | - if (!array_key_exists($controller->getLayout(), $config["view_manager"]["template_map"])) |
|
| 246 | - throw new Exception\PageNotFoundException("The 'template' " . $layout . " was not defined in module.config.php"); |
|
| 249 | + if (!array_key_exists($controller->getLayout(), $config["view_manager"]["template_map"])) { |
|
| 250 | + throw new Exception\PageNotFoundException("The 'template' " . $layout . " was not defined in module.config.php"); |
|
| 251 | + } |
|
| 247 | 252 | |
| 248 | 253 | $template = $config["view_manager"]["template_map"][$controller->getLayout()]; |
| 249 | 254 | |
| 250 | - if (!file_exists($template)) |
|
| 251 | - throw new Exception\PageNotFoundException("The 'template' " . $template . " does not exists"); |
|
| 255 | + if (!file_exists($template)) { |
|
| 256 | + throw new Exception\PageNotFoundException("The 'template' " . $template . " does not exists"); |
|
| 257 | + } |
|
| 252 | 258 | |
| 253 | 259 | include $template; |
| 254 | 260 | } |
@@ -277,8 +283,9 @@ discard block |
||
| 277 | 283 | */ |
| 278 | 284 | public function content() |
| 279 | 285 | { |
| 280 | - if (!file_exists($this->view)) |
|
| 281 | - throw new Exception\ViewNotFoundException("The 'view' template " . $this->view . " does not exists"); |
|
| 286 | + if (!file_exists($this->view)) { |
|
| 287 | + throw new Exception\ViewNotFoundException("The 'view' template " . $this->view . " does not exists"); |
|
| 288 | + } |
|
| 282 | 289 | |
| 283 | 290 | include $this->view; |
| 284 | 291 | } |