Class 'HTML' 未找到(视图:C:\xampp\htdocs\laravel_demo\resources\views\pages\registration.blade.php)

Class 'HTML' not found (View: C:\xampp\htdocs\laravel_demo\resources\views\pages\registration.blade.php)

我是 laravel 5.3 的初学者,我已将 href link 添加到我的 html 表单中,但出现

之类的错误

Class 'HTML' not found (View: C:\xampp\htdocs\laravel_demo\resources\views\pages\registration.blade.php)

我参考以下 link 安装表格和 Html

Installation

我的浏览页面:

{{Form::open(array('action' => 'RegistrationController@store', 'method' => 'post'))}}
<table>
    <tr>
        <td>
           Entr SNO:
        </td>
        <td>
         {!! Form::text('sno', null, ['class' => 'form-control']) !!}
        </td>
    </tr>
    <tr>
         <td>
          Enter Name:
        </td>
        <td>
         {!! Form::text('sname', null, ['class' => 'form-control']) !!}
        </td>
    </tr>
    <tr>
         <td>
          Enter Course:
        </td>
        <td>
         {!! Form::text('course', null, ['class' => 'form-control']) !!}
        </td>
    </tr>
    <tr>
         <td>
           Entr SNO:
        </td>
        <td>
       {{ Form::select('number', [1, 2, 3], null, ['class' => 'field']) }}
        </td>
    </tr>
        <tr>
            <td>
    {!! Form::submit('Submitform', ['class' => 'btn btn-primary']) !!}
            </td>
            <td>
               {{ HTML::link('http://test.com') }}
            </td>
    </tr>
</table>
{!! Form::close() !!}

表单运行良好,但是当我添加 'href' link 时,working.Please 帮帮我

你可以试试 laravel :

URL::route('router_name','parameter_if_require')

做如下例子 这里有 single_post 路线,它需要 id 所以我可以生成 link 像下面这样的东西:

<a href="{{ URL::route('single_post', $post->id) }}">View Post</a>

更多检查 here

如果你想直接使用 link 那么你可以使用

<a href="{{ URL::to('/your_static_url') }}">Name</a>

Laravel 正在从 5.3 的内置包中删除 HTML ServiceProvider,您可以使用 LaravelCollectives 安装它或使用辅助函数。

urlroutes这样的辅助函数,这里你必须自己写html。

<a href="{{url('Could be absolute or relative')}}">name</a>

您可以在此处阅读更多帮助函数,Laravel Helpers

问题在于您尝试使用的 class 的大写。

如果您按照 laravelcollective/html 包的说明进行操作,您将在 config/app.php 文件中添加此别名:

'Html' => Collective\Html\HtmlFacade::class,

但是,在您的 blade 中,您正试图将外观用作 HTML。在您的 blade 文件中,将您的行更改为:

{{ Html::link('http://test.com') }}

注:Html::,不是HTML::

<a href="{{'presentation_page'}}/{{$latest_file_uploads->id}}" class="title" title = "{{$latest_file_uploads->file_name}}" >

像这样尝试它会很好

它的 html 包错误...所以安装 HTML 包 然后按照以下步骤移动。 处理(1)

step(1) Go -> composer.json-> "require":{ .... "laravelcollective/html": "~5.0"

step(2) cmd
      C:\xampp\htdocs\any_project file> composer update
step(3) app.php-config
     add folloewing these statement.
     -> 'provider' => [ Collective\Html\HtmlServiceProvider::class, ]
     ->'aliases'   => [ 'Html' => Collective\Html\HtmlFacade::class,
                       'Form' => Collective\Html\FormFacade::class,]

进程(2)

步骤(1) Go -> composer.json-> "require":{ .... "illuminate/html":"5.*"

步骤(2)

cmd
          C:\xampp\htdocs\any_project file> composer update
    step(3) app.php-config
         add folloewing these statement.
         -> 'provider' => [ Illiminate\Html\HtmlSeviceProvider::class, ]
         ->'aliases'   => [ 'Html' => Illuminate\Html\HtmlFacade::class,]