Laravel 5: Class 'HTML' not found

北城以北 提交于 2019-12-19 19:37:09

问题


I'm just getting started with Laravel. I'm in a controller method and I say:

return \View::make('scrape', $data);

Then in scrape.blade.php I have:

@extends('layouts.master');

Finally, in layouts/master.blade.php I have:

{{ HTML::style('css/bootstrap.min.css') }}

And that where things seem to fall apart and I get:

FatalErrorException in 002eb18bb71fd3ec1de058967b799d49 line 6: Class 'HTML' not found

What am I doing wrong? Thanks for your help.


回答1:


Searching on google I found this

"By default in Laravel 5.0, Html and Form are not embedded anymore."

You need to add this package to you application.




回答2:


Please use above links and last change HTML to Html.

eg:

{{ HTML::style('css/bootstrap.min.css') }} 

to

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

its working.



来源:https://stackoverflow.com/questions/30087145/laravel-5-class-html-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!