How to add HTML5 custom data-* attribute to Laravel 4 blade template?

Stella Lie

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!

David Barker

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]

編集
0

コメントを追加

0

関連記事

分類Dev

getimagesize with Laravel 4 Blade template

分類Dev

Laravel Test Custom Blade If

分類Dev

Laravel Blade Template - How to use incremental variable in foreach loop

分類Dev

HTML/CSS How to apply CSS to "a" with custom data attribute?

分類Dev

How to add custom attribute to customer export csv

分類Dev

How can I add a shorthand if statement in blade, laravel?

分類Dev

how to create pagination links from json data in laravel blade

分類Dev

How to save the data using a modal from Laravel blade?

分類Dev

Laravel: How to get data from View/Blade and pass to Controller

分類Dev

Create custom blade html elements in blade

分類Dev

Laravel 5.2 conditional extends template in Blade

分類Dev

Display data of Laravel Notification in laravel blade

分類Dev

How to use Laravel blade custom function with the use view-passed variables

分類Dev

How to add custom js to HTML

分類Dev

How to include a blade template in different directory?

分類Dev

How to add RectIntl Formatted message as html attribute

分類Dev

Manipulate Wordpress Menu href attribute on custom template

分類Dev

how to add skin to a video element in html5

分類Dev

How to pass arguments in a custom blade directive?

分類Dev

Laravel show s3 image in blade template

分類Dev

Angular ng-include not working with laravel views : blade template

分類Dev

How do I add html to an emberjs template?

分類Dev

Log4J2 JSONLAYOUT How to add custom Parameters

分類Dev

How to add custom error responses in Http4s?

分類Dev

How to add custom stock status to products in WooCommerce 4+

分類Dev

How to write html custom attribute in less use Mixins

分類Dev

rails render json add custom attribute

分類Dev

rails render json add custom attribute

分類Dev

How to view data decode json in blade

Related 関連記事

  1. 1

    getimagesize with Laravel 4 Blade template

  2. 2

    Laravel Test Custom Blade If

  3. 3

    Laravel Blade Template - How to use incremental variable in foreach loop

  4. 4

    HTML/CSS How to apply CSS to "a" with custom data attribute?

  5. 5

    How to add custom attribute to customer export csv

  6. 6

    How can I add a shorthand if statement in blade, laravel?

  7. 7

    how to create pagination links from json data in laravel blade

  8. 8

    How to save the data using a modal from Laravel blade?

  9. 9

    Laravel: How to get data from View/Blade and pass to Controller

  10. 10

    Create custom blade html elements in blade

  11. 11

    Laravel 5.2 conditional extends template in Blade

  12. 12

    Display data of Laravel Notification in laravel blade

  13. 13

    How to use Laravel blade custom function with the use view-passed variables

  14. 14

    How to add custom js to HTML

  15. 15

    How to include a blade template in different directory?

  16. 16

    How to add RectIntl Formatted message as html attribute

  17. 17

    Manipulate Wordpress Menu href attribute on custom template

  18. 18

    how to add skin to a video element in html5

  19. 19

    How to pass arguments in a custom blade directive?

  20. 20

    Laravel show s3 image in blade template

  21. 21

    Angular ng-include not working with laravel views : blade template

  22. 22

    How do I add html to an emberjs template?

  23. 23

    Log4J2 JSONLAYOUT How to add custom Parameters

  24. 24

    How to add custom error responses in Http4s?

  25. 25

    How to add custom stock status to products in WooCommerce 4+

  26. 26

    How to write html custom attribute in less use Mixins

  27. 27

    rails render json add custom attribute

  28. 28

    rails render json add custom attribute

  29. 29

    How to view data decode json in blade

ホットタグ

アーカイブ