@@ -67,6 +67,6 @@ |
||
67 | 67 | */ |
68 | 68 | public function getHelperClass($name) |
69 | 69 | { |
70 | - return '\Nip\Helpers\View\\' . $name; |
|
70 | + return '\Nip\Helpers\View\\'.$name; |
|
71 | 71 | } |
72 | 72 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | public function initBasePath() |
28 | 28 | { |
29 | - $this->setBasePath(MODULES_PATH . Request::instance()->getModuleName() . '/views/'); |
|
29 | + $this->setBasePath(MODULES_PATH.Request::instance()->getModuleName().'/views/'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -9,7 +9,7 @@ |
||
9 | 9 | { |
10 | 10 | public function initBasePath() |
11 | 11 | { |
12 | - $this->setBasePath(MODULES_PATH . Request::instance()->getModuleName() . '/views/'); |
|
12 | + $this->setBasePath(MODULES_PATH.Request::instance()->getModuleName().'/views/'); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | public function output($view, $name) |
@@ -25,11 +25,11 @@ |
||
25 | 25 | $helpersCollection = HelpersCollection::getInstance(); |
26 | 26 | $helpersCollection->setEngine($engine); |
27 | 27 | |
28 | - $engine->addMethod('getHelper', function ($name) use ($helpersCollection) { |
|
28 | + $engine->addMethod('getHelper', function($name) use ($helpersCollection) { |
|
29 | 29 | return $helpersCollection->getHelper($name); |
30 | 30 | }); |
31 | 31 | |
32 | - $engine->addMethod('hasHelper', function ($name) use ($helpersCollection) { |
|
32 | + $engine->addMethod('hasHelper', function($name) use ($helpersCollection) { |
|
33 | 33 | return $helpersCollection->hasHelper($name); |
34 | 34 | }); |
35 | 35 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function register(Engine $engine) |
22 | 22 | { |
23 | - $engine->registerFunction('load', function (...$arguments) use ($engine) { |
|
23 | + $engine->registerFunction('load', function(...$arguments) use ($engine) { |
|
24 | 24 | $view = array_shift($arguments); |
25 | 25 | $variables = array_shift($arguments); |
26 | 26 | $return = array_shift($arguments); |
@@ -224,15 +224,15 @@ discard block |
||
224 | 224 | */ |
225 | 225 | protected function findInPaths($name, $paths) |
226 | 226 | { |
227 | - foreach ((array)$paths as $path) { |
|
227 | + foreach ((array) $paths as $path) { |
|
228 | 228 | $file = $this->getViewFilename($name); |
229 | - $viewPath = $path . '/' . $file; |
|
229 | + $viewPath = $path.'/'.$file; |
|
230 | 230 | if (file_exists($viewPath)) { |
231 | 231 | return $viewPath; |
232 | 232 | } |
233 | 233 | } |
234 | 234 | throw new TemplateNotFound($name, $paths, |
235 | - 'View [' . $name . '] not found in paths [' . implode(', ', $paths) . '].'); |
|
235 | + 'View ['.$name.'] not found in paths ['.implode(', ', $paths).'].'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | */ |
245 | 245 | protected function getViewFilename($name) |
246 | 246 | { |
247 | - return $name . '.php'; |
|
247 | + return $name.'.php'; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -50,7 +50,7 @@ |
||
50 | 50 | public function render($name, array $data = []) |
51 | 51 | { |
52 | 52 | if ($this->isBlock($name)) { |
53 | - $name = '/' . $this->blocks[$name]; |
|
53 | + $name = '/'.$this->blocks[$name]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return parent::render($name, $data); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $reflector = new ReflectionClass(static::class); |
47 | 47 | $dirName = dirname($reflector->getFileName()); |
48 | 48 | |
49 | - return dirname($dirName, 2) . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR; |
|
49 | + return dirname($dirName, 2).DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function setBasePath($path) |
35 | 35 | { |
36 | - $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
36 | + $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
37 | 37 | $this->setDirectory($path); |
38 | 38 | $this->getResolveTemplatePath()->prependPath($path); |
39 | 39 |