Html::style class error resolution in Laravel

Source: Internet
Author: User


Html::style Class Error resolution in Laravel

In Laravel, the HTML class can easily implement a reference to CSS files, JS files, and so on. For example, the traditional introduction method is:

<link rel=stylesheet type= "text/css" href= "Example.css" >

But the HTML classes in Laravel are:

{{Html::style (' Css/example.css ')}}

{{Html::style (' Css/example.css ')}}

As you can see, Laravel saved us some time.


However, sometimes the following error occurs in Laravel5, prompting the ' HTML ' class to not find it. That is because the class model was not installed in the Laravel installation.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/7C/wKioL1X_kuTx3732AAEL2Kmcayc358.jpg "title=" 1.png " alt= "Wkiol1x_kutx3732aael2kmcayc358.jpg"/>

2. Workaround:

2.1in the"/composer.json"inside "Require" block to supplement the following and save:" illuminate/html": "5.* "

The result of the modification is as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/7C/wKioL1X_krGQMZZwAADKxbjaptE996.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1x_krgqmzzwaadkxbjapte996.jpg "/>

2.2 in the root directory of the Web site cmd To Run the command: Composer Update

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/7E/wKiom1X_kHTAIlelAASVfF_VJIw407.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1x_khtailelaasvff_vjiw407.jpg "/>

2.3 in the " config/app.php" inside the "providers" Add content:

Illuminate\html\htmlserviceprovider::class,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/7C/wKioL1X_krKS5YoUAAEbiSH5Xeo240.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1x_krks5youaaebish5xeo240.jpg "/>

2.4 in the " config/app.php" inside the "aliases" Add content:

' HTML ' = Illuminate\html\htmlfacade::class,

' Form ' = Illuminate\html\formfacade::class,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/7E/wKiom1X_kHSCxQTXAADafVhxeiI326.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1x_khscxqtxaadafvhxeii326.jpg "/>

2.5 need to note: write should be {!! $var!!} and not {{$var}}; The latter is the wording of Laravel4.

If you think {!! $va !!} if it's too much trouble, you can go. routes.php inside plus

Blade::setrawtags (' {{', '}} '); at this point, you can continue to use {{$var}} up.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/7C/wKioL1X_lQ-if_1AAAGXZfq7Asg801.jpg "title=" 14.png "alt=" Wkiol1x_lq-if_1aaagxzfq7asg801.jpg "/>


2.6 Save, refresh the page.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/7C/wKioL1X_krKxWBI_AAFq1_huxPk912.jpg "style=" float: none; "title=" 6.png "alt=" Wkiol1x_krkxwbi_aafq1_huxpk912.jpg "/>


This article from the "Good Learning Day Up" blog, please be sure to keep this source http://sunrising.blog.51cto.com/10729461/1696719

Html::style class error resolution in Laravel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.