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.

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

2 Comments

I do not fully understand this Do I have to add two ^^at the end or where does it exactly go?
@Thankyou You have to change your string: 'I'm looking for ...' on line 5 from your code to 'I\'m looking for ...'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.