Same problem
{{ Form::open(['action' => 'user.login', 'method' => 'post', 'class' => 'navbar-form']) }}
{{ Form::token() }}
{{ Form::text('username', '', array('class' => 'input-small', 'placeholder' => trans('user.username'))) }}
{{ Form::password('password', array('class' => 'input-small', 'placeholder' => trans('user.password'))) }}
{{ Form::submit(trans('user.login')) }}
{{Form::close()}}
Maybe if we are not requiring in composer bad version?
I have to do this now, since my last update of the dev version.
{!! Form::open(array('action' => 'HomeController@index')) !!}
I get the "Call to a member function domain() on a non-object" if the controller function requested does not have a route defined.
$router->get('/', 'HomeController@index');
If you name your routes you could use this instead,
$router->get('/', ['as' => 'home', 'uses' => 'HomeController@index']);
{!! Form::open(array('route' => 'home')) !!}
Maybe need to use the namespace for your route action since controllers are now that way in L5.
{!! Form::open(array('action' => '\App\Http\Controllers\HomeController@index')) !!}
vs
{!! Form::open(array('action' => 'HomeController@index')) !!}
That does work, but only if there is a route that uses the HomeController@index. If I direct to another function in HomeController,
{!! Form::open(array('action' => '\App\Http\Controllers\HomeController@test')) !!}
I get the "Call to a member function domain() on a non-object" error as i have no route assigned in my routes file using the HomeController@test
I'd say the "Call to a member function domain() on a non-object" is directly related to if there is a route or not using the controller referenced.
ok, in my case it is fixed after I changed my form open method like that: old one:
{{ Form::open(['action' => 'user.login', 'method' => 'post', 'class' => 'navbar-form']) }}
new one:
{{ Form::open(['route' => 'user.login', 'method' => 'post', 'class' => 'navbar-form']) }}
but now I have a new problem: Form-Code isn't printed as HTML-Code, like it would go through html_entities bevor showed
<form method="POST" action="http://localhost/login" accept-charset="UTF-8" class="navbar-form"><input name="_token" type="hidden" value="Z0toZCVVad5jRzWAss3L1HlYMSABiNutyOvABWJq">
this is what I see in the browser now... so in source code it's this:
<form method="POST" action="http://localhost/register" accept-charset="UTF-8" class="navbar-form"><input name="_token" type="hidden" value="Z0toZCVVad5jRzWAss3L1HlYMSABiNutyOvABWJq">
Blade in Laravel 5 has a new security feature. It will autoescape everything you put between {{ and }}. You need to use
{!! Form::open(['route' => 'user.login', 'method' => 'post', 'class' => 'navbar-form']) !!}
There is some more info on this over at Laracasts.
Although I didn't find it on my own: This is one of the awesome cool things why I love laravel.... Thanks guys - now's everything fine...
dakira said:
Blade in Laravel 5 has a new security feature. It will autoescape everything you put between {{ and }}. You need to use
{!! Form::open(['route' => 'user.login', 'method' => 'post', 'class' => 'navbar-form']) !!}
There is some more info on this over at Laracasts.
I'm always having thesre error with 'route' : ErrorException in UrlGenerator.php line 237: Route [contact.store] not defined. (View: D:\www\mycontact\resources\views\pages\contact.blade.php)
But when i use 'url' , there is no error message...
How to fix that ?
Two problems with your implementation:
add in Providers[] :
'Illuminate\Html\HtmlServiceProvider',
add in Facades[]:
'HTML' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community