Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 259 forks source link

Update BinyException.php #91

Closed tiltysola closed 5 years ago

tiltysola commented 5 years ago

第 46 行新增: $params['webRoot'] = App::$base->router->rootPath;

原因: 当关闭DEBUG模式后出现 controller/action 不存在的情况后会抛出 Response 异常,但是没有经过app层导致不会获取到 webRoot 参数,导致 exception.tpl.php 无法接收到 webRoot 参数从而无法获取到样式表。

比如: Failed to load resource: the server responded with a status of 404 (Not Found) uikit.min.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) ydy.png:1 Failed to load resource: the server responded with a status of 404 (Not Found) main.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) custom.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) uikit-icons.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) uikit.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) font.ttf:1 Failed to load resource: the server responded with a status of 404 (Not Found) ydy.png:1 Failed to load resource: the server responded with a status of 404 (Not Found) uikit-icons.min.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) 123:1 Failed to load resource: the server responded with a status of 404 (Not Found) main.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) custom.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) uikit.min.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)