Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htmlentities() expects parameter 1 to be string, array given

I'm trying to add a class to a laravel form. The array is being passed as the third argument, as 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 displays as expected (unstyled). I can't see what I'm doing wrong here - can anyone help?

like image 816
babbaggeii Avatar asked Mar 27 '26 17:03

babbaggeii


2 Answers

{{ Form::text('text', $variable->name, array('class' => 'form-control')) }}
like image 52
JohnTaa Avatar answered Mar 29 '26 07:03

JohnTaa


I can see from the api that there is another argument expected:

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

('text', $name, $value, $options)
like image 31
babbaggeii Avatar answered Mar 29 '26 07:03

babbaggeii



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!