MissingTemplateException::$file 必须是字符串(如 Exception 类中所示)
我使用的是 PHP8
,项目位于 Cakephp4
中。 对于任何单个通知
或警告
,它都会给出模板异常错误
并破坏项目。
Fatal error: Type of Cake\View\Exception\MissingTemplateException::$file must be string (as in class Exception)
是否有任何解决方案可以解决此问题,以便可以排除通知或警告
并且视图可以正常工作?
I am using PHP8
and the project is in Cakephp4
.
For any single notice
or warning
, it gives Template Exception Error
and breaks the project.
Fatal error: Type of Cake\View\Exception\MissingTemplateException::$file must be string (as in class Exception)
Is there any solution for this issue, so that notice or warnings
can be excluded and the view will work fine?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
致命错误
来自以下文件:https://github.com/cakephp/cakephp/blob/4.x/src/View/Exception/MissingTemplateException.php
但是这个问题在最新的已经解决了4.3.0 版本,
其中属性
$file
被$filename
替换,以免与\Exception 中的属性
。$file
冲突您应该更新 CakePHP 并消除该错误。
The
Fatal error
comes from the following file:https://github.com/cakephp/cakephp/blob/4.x/src/View/Exception/MissingTemplateException.php
But the problem is already solved in the most current 4.3.0 version,
where the property
$file
got replaced by$filename
to not conflict with the property$file
in\Exception
.You should update CakePHP and to get rid of the error.