0

I always get a parse error and I do not know why. DO I have to add ."" or do I have a syntax error? Thank you.

{{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 ...')) . "<br>" }}
                        </div>

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

                        <div class="hsb-container">

                            <div class="hsb-select">
                            {{Form::select('selection', 
                            array('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', 
                            array('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::open(close)}}

The error is in the Form::text line.

What is wrong here, thank you for your help and your advise.

Thankyou
  • 159
  • 1
  • 3
  • 11

1 Answers1

1

You have to escape your single quote in your string like this:

(Because otherwise you will end the string there!)

So from:

'I'm looking for ...'
^ ^String end
|String start

To:

'I\'m looking for ...'
^                    ^String end
|String start  

Also if your interested in which error means what this explain's it pretty good:

PHP Parse/Syntax Errors; and How to solve them?

Community
  • 1
  • 1
Rizier123
  • 58,877
  • 16
  • 101
  • 156
  • I do not fully understand this Do I have to add two ^^at the end or where does it exactly go? – Thankyou Nov 29 '14 at 13:41
  • @Thankyou You have to change your string: `'I'm looking for ...'` on line 5 from your code to `'I\'m looking for ...'` – Rizier123 Nov 29 '14 at 13:42