iconoclast
iconoclast

Reputation: 22610

How to specify extra HTML attributes?

The ability to add arbitrary HTML attributes to your form elements is pretty basic, but seems to be mostly unavailable in Laravel. It is mentioned in Laravel's documentation for Form::label but not for anything else:

I assumed this was just a shortcoming of the documentation, but when I tested this on Form::select, I found it does not work there:

{{ Form::select('ad_week', $report_list_filters['ad_week'], ['id'=>'ad_week']) }}

(I tried again using the older & more verbose syntax for associative arrays, but that didn't help either.)

Upvotes: 1

Views: 75

Answers (1)

Brian Dillingham
Brian Dillingham

Reputation: 9356

Check out the official api or source code for method parameters when the docs aren't clear enough

select($name, $list, $selected = null, $options); select has an extra parameter.

{{ Form::select('ad_week', $report_list_filters['ad_week'], '', ['id'=>'ad_week']) }}

Upvotes: 2

Related Questions