【问题标题】:Class Html not found error in laravel 5在 laravel 5 中找不到类 Html 错误
【发布时间】:2016-03-22 13:59:04
【问题描述】:

我将这些包添加到我的 laravel composer.json 中:

"laravelcollective/html": "~5.0"

我添加了这些

'Collective\Html\HtmlServiceProvider', 

在提供者和这些

'Form'=> 'Collective\Html\FormFacade','Html=>'Collective\Html\HtmlFacade',

在别名中..

但我不能在我的 HTML 文件 {{ html::style('/css/AdminLTE.min.css') }} 中进行这样的更改,它的显示 HTML Class Not Found

我签到了修补匠

>>> Form::text('foo')
=> "<input name=\"foo\" type=\"text\">"

但它的工作..有什么帮助吗??

【问题讨论】:

  • 你使用html ( html::style...) ,但是别名是Html 而不是html,也许这就是问题所在。
  • 你做了composer install吗?

标签: laravel laravel-5 laravel-routing


【解决方案1】:

Html 和 Form 类已从 Laravel 5 中弃用。您可以使用 Laravel Collective 访问类似的功能。

【讨论】:

    【解决方案2】:

    您有一个拼写错误。试试这个:

    {{ Html::style('/css/AdminLTE.min.css') }}
    

    【讨论】:

      【解决方案3】:

      检查this link,或试试这个:

      在 composer.json 的 require 部分添加这个

      "illuminate/html": "5.*"
      

      并运行作曲家更新。

      打开你的 config/app.php

      在'providers'数组下添加添加这个

      Illuminate\Html\HtmlServiceProvider::class,
      

      在'aliases'数组下添加这个

      'Form'      => Illuminate\Html\FormFacade::class,
      'Html'      => Illuminate\Html\HtmlFacade::class,
      

      在你的刀片模板下,像这样使用

      {!! Html::image('uploads/zami.jpg') !!}
      

      【讨论】:

        猜你喜欢
        • 2016-11-26
        • 2015-07-17
        • 1970-01-01
        • 2016-02-08
        • 2017-11-07
        • 2018-07-16
        • 2018-01-17
        • 2015-05-05
        • 1970-01-01
        相关资源
        最近更新 更多