表单错误htmlentities()期望参数1为字符串,给定数组且无行 [英] Form error htmlentities() expects parameter 1 to be string, array given and no line

查看:153
本文介绍了表单错误htmlentities()期望参数1为字符串,给定数组且无行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我将错误更改为简单的HTML,该错误就消失了.

If I change the error to simple HTML, the error is gone.

{{Form::open(array('url'=>'')) . "" }}
                    <div class="basic-form">

它继续:(无法在此处粘贴更多代码)

and it goes on: (cannot paste more code here)

                        <div class="hsb-input-1">
                            {{Form::text('user_query', array('class'=>'form-control', 'placeholder'=>'I\'m looking for qualified personnel in ...')) }}
                        </div>

                        <div class="hsb-text-1">Language</div>

                        <div class="hsb-container">

                            <div class="hsb-select">
                            {{Form::select('selection', 
                                ['all'=> 'Select all', 
                                'c' => 'C/C++/C#', 
                                'html' => 'HTML/CSS/Design', 
                                'java'=> 'Java', 
                                'javascript'=>'Javascript', 
                                'php'=>'PHP', 
                                'python'=>'Python', 
                                'ruby'=>'Ruby', 
                                'xml'=>'XML/XSLT/Xquery', 
                                'fortran'=>'Fortran', 
                                'vb'=>'VB', 
                                'sql'=>'SQL', 
                                'abap'=>'ABAP', 
                                'oc'=>OC, 
                                'swift'=>'SWIFT'], 
                                all,
                                ['class' => 'form-control']) 
                            }}
                            </div>
                        </div>

                        <div class="hsb-submit">
                            {{Form::submit('Submit', array('class' => 'btn btn-default btn-block', 'id' => 'submit'))}}
                            <!--<input type="submit" name="search" class="btn btn-default btn-block" value="Search"> -->
                        </div>
                    </div>

                {{Form::close()}}

我该怎么做才能更正错误消息?我认为我的表格有误.

What can I do to correct the error message? I think I have a mistake in the form.

推荐答案

您以错误的方式使用它. text的第二个参数不是选项数组,而是值(参考),而不是:

You use it in wrong way. The second argument for text is not array of options but value (reference) so instead of:

{{Form::text('user_query', array('class'=>'form-control', 'placeholder'=>'I\'m looking for qualified personnel in ...')) }}

应该是:

{{Form::text('user_query', null, array('class'=>'form-control', 'placeholder'=>'I\'m looking for qualified personnel in ...')) }}

这篇关于表单错误htmlentities()期望参数1为字符串,给定数组且无行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆