Htmlentities () expects parameter 1 to be a string, array given

I am trying to add a class to a laravel form. The array is passed as the third argument if required, but I get the above error.

{{ Form::input('text', $variable->name, array('class' => 'form-control')) }}

If I get rid of the third argument, the form will display as expected (uninstalled). I don’t see what I am doing wrong here - can anyone help?

+3
source share
3 answers
{{ Form::text('text', $variable->name, array('class' => 'form-control')) }}
+7
source

I see from the api that another argument is expected:

http://laravel.com/api/source-class-Illuminate.Html.FormBuilder.html#235-246

('text', $name, $value, $options)
+2
source

Form::input() - . . Laravel FormBuilder:

public function input($type, $name, $value = null, $options = array())
+2

All Articles