Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blade 模板 兼容问题 #195

Closed
icellus opened this issue May 21, 2021 · 3 comments
Closed

blade 模板 兼容问题 #195

icellus opened this issue May 21, 2021 · 3 comments

Comments

@icellus
Copy link

icellus commented May 21, 2021

vendor\workerman\webman-framework\src\Exception\ExceptionHandler.php

75 if (\method_exists($exception, 'render')) {
76 return $exception->render();
77 }

如果传入blade view 文件的 变量未定义 时,会抛出 Illuminate\View\ViewException 异常, 但是这个异常需要的参数 未正常传入,且 返回值 和 ExceptionHandler 期望的是不同的。

是否考虑注释这几行代码?

@walkor
Copy link
Owner

walkor commented May 21, 2021

最终异常和调用栈是什么?

@icellus
Copy link
Author

icellus commented May 24, 2021

最终异常和调用栈是什么?

当 试图 在 view 中调用未定义变量的时候

ArgumentCountError: Too few arguments to function Illuminate\View\ViewException::render(),
0 passed in /var/www/vendor/workerman/webman-framework/src/Exception/ExceptionHandler.php on line 76 and exactly 1 expected in /var/www/vendor/illuminate/view/ViewException.php:33
Stack trace:
#0 /var/www/vendor/workerman/webman-framework/src/Exception/ExceptionHandler.php(76): Illuminate\View\ViewException->render()
#1 /var/www/support/exception/Handler.php(38): Webman\Exception\ExceptionHandler->render(Object(support\Request), Object(Illuminate\View\ViewException))
#2 /var/www/vendor/workerman/webman-framework/src/App.php(205): support\exception\Handler->render(Object(support\Request), Object(Illuminate\View\ViewException))
#3 /var/www/vendor/workerman/webman-framework/src/App.php(181): Webman\App::exceptionResponse(Object(Illuminate\View\ViewException), Object(support\Request))
#4 /var/www/vendor/workerman/workerman/Connection/TcpConnection.php(637): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))
#5 /var/www/vendor/workerman/workerman/Events/Select.php(293): Workerman\Connection\TcpConnection->baseRead(Resource id #228)
#6 /var/www/vendor/workerman/workerman/Worker.php(2430): Workerman\Events\Select->loop()
#7 /var/www/vendor/workerman/workerman/Worker.php(1554): Workerman\Worker->run()
#8 /var/www/vendor/workerman/workerman/Worker.php(1384): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#9 /var/www/vendor/workerman/workerman/Worker.php(1358): Workerman\Worker::forkWorkersForLinux()
#10 /var/www/vendor/workerman/workerman/Worker.php(1691): Workerman\Worker::forkWorkers()
#11 /var/www/vendor/workerman/workerman/Worker.php(1640): Workerman\Worker::monitorWorkersForLinux()
#12 /var/www/vendor/workerman/workerman/Worker.php(544): Workerman\Worker::monitorWorkers()
#13 /var/www/start.php(156): Workerman\Worker::runAll() #14 {main}

@walkor
Copy link
Owner

walkor commented May 24, 2021

已经去掉了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants