@@ -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 | |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // 模板不存在 抛出异常 |
| 79 | 79 | if (!is_file($template)) { |
| 80 | - throw new TemplateNotFoundException('template not exists:' . $template, $template); |
|
| 80 | + throw new TemplateNotFoundException('template not exists:'.$template, $template); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $this->template = $template; |
| 84 | 84 | |
| 85 | 85 | // 记录视图信息 |
| 86 | 86 | $this->app->log |
| 87 | - ->record('[ VIEW ] ' . $template . ' [ ' . var_export(array_keys($data), true) . ' ]'); |
|
| 87 | + ->record('[ VIEW ] '.$template.' [ '.var_export(array_keys($data), true).' ]'); |
|
| 88 | 88 | |
| 89 | 89 | extract($data, EXTR_OVERWRITE); |
| 90 | 90 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $this->content = $content; |
| 104 | 104 | |
| 105 | 105 | extract($data, EXTR_OVERWRITE); |
| 106 | - eval('?>' . $this->content); |
|
| 106 | + eval('?>'.$this->content); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | private function parseTemplate(string $template): string |
| 116 | 116 | { |
| 117 | 117 | if (empty($this->config['view_base'])) { |
| 118 | - $this->config['view_base'] = $this->app->getRootPath() . 'view' . DIRECTORY_SEPARATOR; |
|
| 118 | + $this->config['view_base'] = $this->app->getRootPath().'view'.DIRECTORY_SEPARATOR; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $request = $this->app->request; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } else { |
| 132 | 132 | $app = isset($app) ? $app : $request->app(); |
| 133 | 133 | // 基础视图目录 |
| 134 | - $path = $this->config['view_base'] . ($app ? $app . DIRECTORY_SEPARATOR : ''); |
|
| 134 | + $path = $this->config['view_base'].($app ? $app.DIRECTORY_SEPARATOR : ''); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $depr = $this->config['view_depr']; |
@@ -151,16 +151,16 @@ discard block |
||
| 151 | 151 | $template = App::parseName($request->action()); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; |
|
| 154 | + $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template; |
|
| 155 | 155 | } elseif (false === strpos($template, $depr)) { |
| 156 | - $template = str_replace('.', DIRECTORY_SEPARATOR, $controller) . $depr . $template; |
|
| 156 | + $template = str_replace('.', DIRECTORY_SEPARATOR, $controller).$depr.$template; |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | 160 | $template = str_replace(['/', ':'], $depr, substr($template, 1)); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - return $path . ltrim($template, '/') . '.' . ltrim($this->config['view_suffix'], '.'); |
|
| 163 | + return $path.ltrim($template, '/').'.'.ltrim($this->config['view_suffix'], '.'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |