This line:
{{ Form::open(['action' => 'AnyController@hello', 'class'=> 'hello']) }}
Will result to:
<form method="POST" action="http://localhost:8000/hello" accept-charset="UTF-8" class="hello">
However, I wanted to add HTML5 custom data-* attribute, such:
<form method="POST" action="http://localhost:8000/hello" accept-charset="UTF-8" class="hello" data-abide>
How do I do that?
Thanks in advance!
In Laravel 4 you can add custom attributes directly to the array.
{{ Form::open(array(
'action' => 'AController@index',
'class' => 'hello',
'data-abide' => true
))
}}
I am unsure whether Laravel will place in attributes that have no value via the Form
facade.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加