sudo composer require "laravelcollective/html":"^5.3.0"
然後在 ./config/app.php
'providers' => [ // ... Collective\Html\HtmlServiceProvider::class, // ... ], //還有 'aliases' => [ // ... 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, // ... ],
如此即可使用
可參考
https://laravelcollective.com/docs/5.3/html
二、各表單元件使用
{{ Form::open(['url' => 'foo/bar',"method"=>"put"]) }}//,不寫就是預設 post
//
{{ Form::close() }}
echo Form::open(['route' => 'route.name'])
echo Form::open(['action' => 'Controller@method'])
帶參數
echo Form::open(['route' => ['route.name', $user->id]])
echo Form::open(['action' => ['Controller@method', $user->id]])
echo Form::open(['url' => 'foo/bar', 'files' => true])
沒有留言:
張貼留言