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

Maniraj Murugan

My blade.php code is:

{!! Form::input('text', 'tactic[]', null, array('id' => 'tactic', 'class' => ' form-control TabOnEnter', 'placeholder' => 'Tactics_1')) !!}

HtmlBuilder.php code is

public function escapeAll($value)
{
    return htmlentities($value, ENT_QUOTES, 'UTF-8');
}

The error message is:

ErrorException in HtmlBuilder.php line 65:
htmlentities() expects parameter 1 to be string, array given (View: /home/seyali-02/dev/htdocs/scam/resources/views/dashboard/Scam/edit.blade.php)

And i have changed the blade.php as like

{!! Form::input('text','', 'tactic[]', null, array('id' => 'tactic', 'class' => ' form-control TabOnEnter', 'placeholder' => 'Tactics_1')) !!}

and

{!! Form::text('name', 'tactic[]', null, array('id' => 'tactic', 'class' => ' form-control TabOnEnter', 'placeholder' => 'Tactics_1')) !!}

and also text('text', .. But nothing works for me and throwing me the same error as i mentioned above.. I have gone through all the similar questions related to this but none of those answers solved my problem . So please avoid doing duplication of this question and give me clear and correct solution..

Kinshuk Lahiri

You are adding tactic[] to the name which is an array and hence when you post the data it is going as an array. Either remove it or at php end use implode.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

date_diff() expects parameter 1 to be DateTimeInterface, string given

From Dev

Warning: explode() expects parameter 2 to be string, array given

From Dev

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

From Dev

Warning: get_class() expects parameter 1 to be object, string given

From Dev

Receiving strtotime() expects parameter 1 to be string, object given error in php

From Dev

Laravel 5 lists htmlentities() expects parameter 1 to be string

From Dev

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

From Dev

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

From Dev

Laravel 5: in_array() expects parameter 2 to be array, object given

From Dev

preg_match() expects parameter 2 to be string, array given

From Dev

strpos() expects parameter 1 to be string, array given Laravel

From Dev

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

From Dev

unknow ERROR (in_array() expects parameter 2 to be array, string given)

From Dev

preg_match() expects parameter 2 to be string, array given Error

From Dev

htmlentities() expects parameter 1 to be string

From Dev

Warning: json_decode() expects parameter 1 to be string, array given

From Dev

How to fix array_values() expects parameter 1 to be array, string given in PHP?

From Dev

PHP Warning: strpos() expects parameter 1 to be string, array given

From Dev

unknow ERROR (in_array() expects parameter 2 to be array, string given)

From Dev

trim() expects parameter 1 to be string, object given

From Dev

laravel 5.2 queries - htmlentities() expects parameter 1 to be string, object given

From Dev

rand() expects parameter 1 to be long, string given

From Dev

laravel error "strtolower() expects parameter 1 to be string"?

From Dev

Seeding pivot table with Laravel 5.5 model factory - mb_strtolower() expects parameter 1 to be string, array given

From Dev

strtotime() expects parameter 1 to be string, array given in codeigniter

From Dev

Warning: array_column() expects parameter 1 to be array, null given in

From Dev

Warning: key() expects parameter 1 to be array, string given

From Dev

Laravel htmlentities() expects parameter 1 to be string, array given after it's converted to string

From Dev

htmlspecialchars() expects parameter 1 to be string, array given Laravel 5.6

Related Related

  1. 1

    date_diff() expects parameter 1 to be DateTimeInterface, string given

  2. 2

    Warning: explode() expects parameter 2 to be string, array given

  3. 3

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

  4. 4

    Warning: get_class() expects parameter 1 to be object, string given

  5. 5

    Receiving strtotime() expects parameter 1 to be string, object given error in php

  6. 6

    Laravel 5 lists htmlentities() expects parameter 1 to be string

  7. 7

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

  8. 8

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

  9. 9

    Laravel 5: in_array() expects parameter 2 to be array, object given

  10. 10

    preg_match() expects parameter 2 to be string, array given

  11. 11

    strpos() expects parameter 1 to be string, array given Laravel

  12. 12

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

  13. 13

    unknow ERROR (in_array() expects parameter 2 to be array, string given)

  14. 14

    preg_match() expects parameter 2 to be string, array given Error

  15. 15

    htmlentities() expects parameter 1 to be string

  16. 16

    Warning: json_decode() expects parameter 1 to be string, array given

  17. 17

    How to fix array_values() expects parameter 1 to be array, string given in PHP?

  18. 18

    PHP Warning: strpos() expects parameter 1 to be string, array given

  19. 19

    unknow ERROR (in_array() expects parameter 2 to be array, string given)

  20. 20

    trim() expects parameter 1 to be string, object given

  21. 21

    laravel 5.2 queries - htmlentities() expects parameter 1 to be string, object given

  22. 22

    rand() expects parameter 1 to be long, string given

  23. 23

    laravel error "strtolower() expects parameter 1 to be string"?

  24. 24

    Seeding pivot table with Laravel 5.5 model factory - mb_strtolower() expects parameter 1 to be string, array given

  25. 25

    strtotime() expects parameter 1 to be string, array given in codeigniter

  26. 26

    Warning: array_column() expects parameter 1 to be array, null given in

  27. 27

    Warning: key() expects parameter 1 to be array, string given

  28. 28

    Laravel htmlentities() expects parameter 1 to be string, array given after it's converted to string

  29. 29

    htmlspecialchars() expects parameter 1 to be string, array given Laravel 5.6

HotTag

Archive