Tapha
Tapha

Reputation: 1511

I am getting an unusual url error in Laravel

As you can see below, I have presented the URL below in a completely normal way, but for some reason I get the error that you can too see below.

What can I be doing?

The code:

{{ Form::open(array('action' => '{{ URL::route('try_login') }}', 'class'=>'login_form', 'id'=>'login_reg_form', 'role' => 'form')) }}

        {{ Form::label('email', 'Email Address', array('class' => 'email')); }}

        {{ Form::text('email', '[email protected]', array('class' => 'form-control')) }}

        {{ Form::label('password', 'Password', array('class' => 'password')); }}

        {{ Form::password('password', array('class' => 'form-control')) }}

        {{ Form::submit('Click Me!'); }}

    {{ Form::close() }}

The error message:

Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_PARSE) 
syntax error, unexpected 'try_login' (T_STRING), expecting ')'


<?php echo Form::open(array('action' => '{{ URL::route('try_login'); ?>', 'class'=>'login_form', 'id'=>'login_reg_form', 'role' => 'form')) }}

Upvotes: 1

Views: 464

Answers (1)

Laurence
Laurence

Reputation: 60038

Your Form::open() function is incorrect. It should be

{{ Form::open(array('action' => URL::route('try_login'), 'class'=>'login_form', 'id'=>'login_reg_form', 'role' => 'form')) }}

Upvotes: 2

Related Questions