@@ -68,8 +68,8 @@ |
||
68 | 68 | $this->addMeta("description", "Advanced use cases and examples"); |
69 | 69 | |
70 | 70 | // Add additional js and css files |
71 | - $this->addCss('my-css','/css/my-css-file.css'); |
|
72 | - $this->addJs('my-js','/js/my-js-file.js'); |
|
71 | + $this->addCss('my-css', '/css/my-css-file.css'); |
|
72 | + $this->addJs('my-js', '/js/my-js-file.js'); |
|
73 | 73 | |
74 | 74 | // Add additional fields to the theme |
75 | 75 | $this->getResponse()->getTheme()->custom_var = "Booyah"; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | */ |
23 | 23 | public function get($var = null) |
24 | 24 | { |
25 | - if($var != null) |
|
25 | + if ($var != null) |
|
26 | 26 | { |
27 | 27 | // load action |
28 | 28 | return $this->_autoaction($var); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | // You can add other views (containers) or text |
84 | 84 | $columns = array( |
85 | 85 | 'one' => new \erdiko\core\View('examples/one'), |
86 | - 'two' => $this->getView('examples/two') . $this->getView('examples/three') |
|
86 | + 'two' => $this->getView('examples/two').$this->getView('examples/three') |
|
87 | 87 | ); |
88 | 88 | |
89 | 89 | $this->setContent($this->getLayout('mustache/2column-mustache', $columns)); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * Hooks |
25 | 25 | */ |
26 | -\erdiko\core\ToroHook::add("404", function ($vars = array()) { |
|
26 | +\erdiko\core\ToroHook::add("404", function($vars = array()) { |
|
27 | 27 | // Toro::serve Legacy |
28 | 28 | $vars['debug'] = \erdiko\core\ErrorHandler::isDebug(); |
29 | 29 | if (empty($vars['message'])) { |
@@ -39,39 +39,39 @@ discard block |
||
39 | 39 | Erdiko::log(\Psr\Log\LogLevel::ERROR, "404 {$vars['path_info']} {$vars['error']}"); |
40 | 40 | $vars['code'] = 404; |
41 | 41 | |
42 | - $theme = new \erdiko\core\Theme( 'bootstrap' ); |
|
43 | - $theme->addCss( 'font-awesome', |
|
44 | - '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' ); |
|
45 | - $theme->addCss( 'font-awesome-animation', |
|
46 | - '/themes/bootstrap/css/font-awesome-animation.css' ); |
|
42 | + $theme = new \erdiko\core\Theme('bootstrap'); |
|
43 | + $theme->addCss('font-awesome', |
|
44 | + '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); |
|
45 | + $theme->addCss('font-awesome-animation', |
|
46 | + '/themes/bootstrap/css/font-awesome-animation.css'); |
|
47 | 47 | |
48 | - $response = new \erdiko\core\Response( $theme ); |
|
49 | - $response->setContent( \Erdiko::getView('error', $vars) ); |
|
48 | + $response = new \erdiko\core\Response($theme); |
|
49 | + $response->setContent(\Erdiko::getView('error', $vars)); |
|
50 | 50 | $response->send(); |
51 | 51 | }); |
52 | 52 | |
53 | -\erdiko\core\ToroHook::add("500", function ($vars = array()) { |
|
53 | +\erdiko\core\ToroHook::add("500", function($vars = array()) { |
|
54 | 54 | // Toro::serve Legacy |
55 | 55 | $vars['debug'] = \erdiko\core\ErrorHandler::isDebug(); |
56 | 56 | $vars['code'] = 500; |
57 | 57 | $vars['message'] = "Sorry, something went wrong."; |
58 | 58 | Erdiko::log(\Psr\Log\LogLevel::ERROR, "{$vars['code']}: {$vars['path_info']} {$vars['error']}"); |
59 | 59 | |
60 | - $theme = new \erdiko\core\Theme( 'bootstrap' ); |
|
61 | - $theme->addCss( 'font-awesome', |
|
62 | - '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' ); |
|
63 | - $theme->addCss( 'font-awesome-animation', |
|
64 | - '/themes/bootstrap/css/font-awesome-animation.css' ); |
|
60 | + $theme = new \erdiko\core\Theme('bootstrap'); |
|
61 | + $theme->addCss('font-awesome', |
|
62 | + '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css'); |
|
63 | + $theme->addCss('font-awesome-animation', |
|
64 | + '/themes/bootstrap/css/font-awesome-animation.css'); |
|
65 | 65 | |
66 | - $response = new \erdiko\core\Response( $theme ); |
|
67 | - $response->setContent( \Erdiko::getView('error', $vars) ); |
|
66 | + $response = new \erdiko\core\Response($theme); |
|
67 | + $response->setContent(\Erdiko::getView('error', $vars)); |
|
68 | 68 | $response->send(); |
69 | 69 | }); |
70 | 70 | |
71 | 71 | // Error management & beautify output. |
72 | -\erdiko\core\ToroHook::add("general_error", function ($vars = array()) { |
|
72 | +\erdiko\core\ToroHook::add("general_error", function($vars = array()) { |
|
73 | 73 | $vars['debug'] = \erdiko\core\ErrorHandler::isDebug(); |
74 | - if(!isset($vars['path_info'])){ |
|
74 | + if (!isset($vars['path_info'])) { |
|
75 | 75 | $vars['path_info'] = $_SERVER['REQUEST_URI']; |
76 | 76 | } |
77 | 77 | Erdiko::log(\Psr\Log\LogLevel::ERROR, "{$vars['code']}: {$vars['path_info']} {$vars['error']}"); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <div class="container"> |
2 | - <?php if(!empty( $this->getTitle() )):?> |
|
2 | + <?php if (!empty($this->getTitle())):?> |
|
3 | 3 | <div class="row"> |
4 | 4 | <div class="col-12"> |
5 | 5 | <h1><?php echo $this->getTitle() ?></h1> |
@@ -5,7 +5,7 @@ |
||
5 | 5 | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], |
6 | 6 | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= |
7 | 7 | 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); |
8 | - })(window,document,'script','dataLayer','<?php echo $tag['container_id'];?>'); |
|
8 | + })(window,document,'script','dataLayer','<?php echo $tag['container_id']; ?>'); |
|
9 | 9 | </script> |
10 | 10 | <?php endif; |
11 | 11 | endforeach; |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php $messages = \erdiko\core\helpers\FlashMessages::get() ?> |
2 | -<?php if(!empty($messages)): ?> |
|
2 | +<?php if (!empty($messages)): ?> |
|
3 | 3 | <div class="container"> |
4 | 4 | <div class="msgs-header"> |
5 | 5 | <div class="row"> |
6 | 6 | <div class="col-lg-12 col-md-12"> |
7 | 7 | |
8 | - <?php foreach($messages as $message): ?> |
|
8 | + <?php foreach ($messages as $message): ?> |
|
9 | 9 | <div class="alert alert-<?php echo $message['type'] ?> alert-dismissible" role="alert"> |
10 | 10 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> |
11 | 11 | <?php echo $message['text'] ?> |
@@ -14,7 +14,7 @@ |
||
14 | 14 | ); |
15 | 15 | |
16 | 16 | // Nested view, insert a themed item using a view |
17 | - for ($i=0; $i<$data['count']; $i++) { |
|
17 | + for ($i = 0; $i < $data['count']; $i++) { |
|
18 | 18 | echo $this->getView('examples/grid/item', $item); |
19 | 19 | } |
20 | 20 | ?> |