找不到Laravel 5 Class'HTML'
我正在尝试使用Laravel 5,但我的{{ HTML::style('style.css') }}
不再起作用.
I am attempting to use Laravel 5 but my {{ HTML::style('style.css') }}
No longer works.
我已经更新了composer.json以在require下包含"illuminate/html": "5.*"
.我已将'Illuminate\Html\HtmlServiceProvider'
添加到app.php下的提供程序数组中,并且添加了
I have updated composer.json to include "illuminate/html": "5.*"
under require. I have added 'Illuminate\Html\HtmlServiceProvider'
to my providers array under app.php and I have added
'Form'=> 'Illuminate\Html\FormFacade',
'HTML'=> 'Illuminate\Html\HtmlFacade'
也是.然后,我运行composer update
我已经重新启动WAMP以确保它仍然无法正常工作.我也曾尝试使用{!! HTML::style('style.css') !!}
,该{!! HTML::style('style.css') !!}
也不起作用.我还需要做些什么才能把它找回来?
as well. I then ran composer update
I have restarted WAMP to make sure and it still does not work. I have also tried to use {!! HTML::style('style.css') !!}
which did not work either. What else do I need to do to get this back?
使用laravel 5. *的任何人都必须使用laravelcollective/html
,因为软件包illuminate/html
被放弃了,您应该避免使用它.
Anybody who are using laravel 5.* have to use laravelcollective/html
because Package illuminate/html
is abandoned, you should avoid using it.
您的composer.json
文件应在require节中包含以下代码(因为我使用的是laravel 5.2,将以5.2的形式提及)
your composer.json
file should contain following code in require section(as i am using laravel 5.2 it will be mentioned as 5.2)
"laravelcollective/html": "5.2.*"
运行composer update
和您的config/app.php
应该在提供程序数组中包含以下代码
and your config/app.php
should contain following code in providers array
'providers' => [
Collective\Html\HtmlServiceProvider::class,
]
和别名应包含
'aliases' => [
'Form' => Collective\Html\FormFacade::class,
'HTML' => Collective\Html\HtmlFacade::class,
]
,请注意,您提到的任何别名都应在代码中显示为
and please note that whatever aliase you mentioned should appear in your code as
{{HTML::linkAction('MemberController@show', 'view', array($value->id))}}