【发布时间】:2015-09-29 17:59:21
【问题描述】:
我正在从 4.2 直接升级到 5.1,但遇到了 Html 和 Form 类的问题。
我按照升级说明做了
- 在 composer.json 中添加 "laravelcollective/html": "~5.0"
- 作曲家更新
- 将 Collective\Html\HtmlServiceProvider::class 添加到 app.php 中的提供程序
- 添加 Form' => Collective\Html\FormFacade::class, Html' => Collective\Html\HtmlFacade::class 到 app.php 中的别名
但我的观点不起作用。我在使用 HTML::router 时得到 Class HTML does not exist 或在使用 link_to_route 时得到 Class html does not exist
我也试过Illuminate\html而不是laravelcollective,我做了一个composer dump-autoload。
完整的错误:
ErrorException in Container.php line 736: Class html does not exist (View: C:\Dev\www\admin\resources\views\clubs\index.blade.php)
ReflectionException in Container.php line 736: Class html does not exist
我错过了什么?
我尝试了每个人的答案,但由于某种原因,没有一个对我有用。最终我创建了一个全新的 laravel 应用程序,复制了我的代码,然后它开始工作,所以虽然解决了实际问题仍然是个谜。
【问题讨论】:
-
请问您的刀片变量之一是什么样的?
{{!! Html.... !!}或{{ Html.... }}? -
我尝试了各种,{{ }} 和 {!! !}} 我尝试了 Html、HTML 和 html,但没有任何效果。我正在考虑完全重新安装 laravel 并从头开始工作。
-
更新:我不得不将所有内容恢复到 laravel 5.0,因为我的新服务器的 PHP 版本无法运行 5.1。当当。
标签: php html laravel exception upgrade