[英]Unable to create form tag in Laravel 5
Directory structure. 目录结构。
My current code is below 我当前的代码如下
{{ Form::open(array('action' => 'SkillsController@store', 'method' => 'POST' }}
{{ Form::close() }}
I got the following error 我收到以下错误
Class 'Form' not found
找不到“表格”类
{{!! Form::open(array('action' => 'SkillsController@store', 'method' => 'POST'}}
{{!! Form::close() !!}}
Still I am facing the same issue. 我仍然面临着同样的问题。
As of Laravel 5, Form helpers were removed and are now maintained and provided by the Laravel Collective. 从Laravel 5开始,Laravel Collective已删除了表单助手,并且现在对其进行维护和提供。
The steps provided in their docs : 他们的文档中提供的步骤:
"laravelcollective/html": "5.1.*"
to the require section of your composer.json
file "laravelcollective/html": "5.1.*"
到composer.json
文件的require部分 composer update
composer update
Collective\\Html\\HtmlServiceProvider::class,
to your array of providers in the congif/app.php
file congif/app.php
文件中Collective\\Html\\HtmlServiceProvider::class,
将Collective\\Html\\HtmlServiceProvider::class,
添加到提供程序数组中 'Form' => Collective\\Html\\FormFacade::class,
and 'Html' => Collective\\Html\\HtmlFacade::class,
to your array of aliases in the config/app.php
file 'Form' => Collective\\Html\\FormFacade::class,
和'Html' => Collective\\Html\\HtmlFacade::class,
到config/app.php
文件中的别名数组 You'll then be able to use them in your views using {!! !!}
然后,您可以使用
{!! !!}
{!! !!}
in your views, like so: {!! !!}
在您看来,如下所示:
{!! Form::open(array('url' => 'foo/bar')) !!}
//
{!! Form::close() !!}
In laravel 5 HTML, and forms not included you should include manually, can follow instructions in this link. 在laravel 5 HTML中,您应该手动添加未包含的表格,可以按照此链接中的说明进行操作。 http://laravel.io/forum/09-20-2014-html-form-class-not-found-in-laravel-5
http://laravel.io/forum/09-20-2014-html-form-class-not-found-in-laravel-5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.