表单错误htmlentities()期望参数1为字符串,给定数组且没有行

时间:2014-11-29 14:31:39

标签: php laravel blade laravel-form

如果我将错误更改为简单HTML,则错误消失。

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

它继续:(不能在这里粘贴更多代码)

                        <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()}}

我该怎么做才能纠正错误信息?我认为表格中有错误。

1 个答案:

答案 0 :(得分:1)

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

{{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 ...')) }}