Class 'Illuminate\Html\HtmlServiceProvider' not found或者form表單不能正常使用解決辦法

來源:互聯網
上載者:User

標籤:應該   profile   from   pos   manual   處理   目錄   ide   htm   

在laravel架構中,form不能正常使用如何處理.

網上搜到的解決方案通常都是一致的,下面分類考慮:

1,開啟根目錄composer.json 檔案, require 裡面增加:

如果laravel是從4版本到5版本的

  "illuminate/html": "~5.0"

  然後執行 composer update

如果本身就是laravel5以上版本的

  直接在網站根目錄開啟命令列,   運行  composer require illuminate/html

2,開啟config/app.php

  在provider下添加  Illuminate\Html\HtmlServiceProvider::class,

  在aliases下添加     

            ‘Form‘ => ‘Illuminate\Html\FormFacade‘,
             ‘Html‘ => ‘Illuminate\Html\HtmlFacade‘,

完成之後,就可以直接使用From對象了:

比如laravel文檔中給的執行個體:

{!! Form::open( [ ‘url‘ => [‘oduct/ajaxFaceimage‘], ‘method‘ => ‘POST‘, ‘id‘ => ‘upload‘, ‘files‘ => true ] ) !!}  <a href="#" class="btn button-change-profile-picture">    <label for="upload-profile-picture">      <span id="upload-avatar">更換新頭像</span>      <input name="image" id="image" type="file" class="manual-file-chooser js-manual-file-chooser js-avatar-field">    </label>  </a>{!! Form::close() !!}

 如果不出其他意外的話,應該模板檔案中的Form就能正常使用了!!!

 

Class 'Illuminate\Html\HtmlServiceProvider' not found或者form表單不能正常使用解決辦法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.