@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: liu21st <[email protected]> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare (strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\view\driver; |
14 | 14 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | // 模板不存在 抛出异常 |
80 | 80 | if (!is_file($template)) { |
81 | - throw new RuntimeException('template not exists:' . $template); |
|
81 | + throw new RuntimeException('template not exists:'.$template); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | $this->template = $template; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $this->content = $content; |
101 | 101 | |
102 | 102 | extract($data, EXTR_OVERWRITE); |
103 | - eval('?>' . $this->content); |
|
103 | + eval('?>'.$this->content); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $appName = isset($app) ? $app : $this->app->http->getName(); |
126 | 126 | $view = $this->config['view_dir_name']; |
127 | 127 | |
128 | - if (is_dir($this->app->getAppPath() . $view)) { |
|
129 | - $path = isset($app) ? $this->app->getBasePath() . ($appName ? $appName . DIRECTORY_SEPARATOR : '') . $view . DIRECTORY_SEPARATOR : $this->app->getAppPath() . $view . DIRECTORY_SEPARATOR; |
|
128 | + if (is_dir($this->app->getAppPath().$view)) { |
|
129 | + $path = isset($app) ? $this->app->getBasePath().($appName ? $appName.DIRECTORY_SEPARATOR : '').$view.DIRECTORY_SEPARATOR : $this->app->getAppPath().$view.DIRECTORY_SEPARATOR; |
|
130 | 130 | } else { |
131 | - $path = $this->app->getRootPath() . $view . DIRECTORY_SEPARATOR . ($appName ? $appName . DIRECTORY_SEPARATOR : ''); |
|
131 | + $path = $this->app->getRootPath().$view.DIRECTORY_SEPARATOR.($appName ? $appName.DIRECTORY_SEPARATOR : ''); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $controller = $request->controller(); |
140 | 140 | if (strpos($controller, '.')) { |
141 | 141 | $pos = strrpos($controller, '.'); |
142 | - $controller = substr($controller, 0, $pos) . '.' . Str::snake(substr($controller, $pos + 1)); |
|
142 | + $controller = substr($controller, 0, $pos).'.'.Str::snake(substr($controller, $pos + 1)); |
|
143 | 143 | } else { |
144 | 144 | $controller = Str::snake($controller); |
145 | 145 | } |
@@ -155,16 +155,16 @@ discard block |
||
155 | 155 | $template = Str::snake($request->action()); |
156 | 156 | } |
157 | 157 | |
158 | - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; |
|
158 | + $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template; |
|
159 | 159 | } elseif (false === strpos($template, $depr)) { |
160 | - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; |
|
160 | + $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | } else { |
164 | 164 | $template = str_replace(['/', ':'], $depr, substr($template, 1)); |
165 | 165 | } |
166 | 166 | |
167 | - return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.'); |
|
167 | + return $path.ltrim($template, '/').'.'.ltrim($this->config['view_suffix'], '.'); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |