Bartosz Rowiński
Bartosz Rowiński

Reputation: 335

Can not display a form in laravel using laravel collective

I want to create form in my laravel page. I use laravel collections for this, but that is not work. I used composer, then pasted commands to providers and alias and when I am doing this in my code:

       {{ Form::open(array('url' => 'foo/bar')) }}
       echo Form::text('username');
       {{ Form::close() }}

I have only returned "echo..." as text.

What can I do to create my own form?

Upvotes: 0

Views: 617

Answers (1)

vstruhar
vstruhar

Reputation: 335

It could be that you are using double curly braces and escaping the generated form html. Try this:

{!! Form::open(array('url' => 'foo/bar')) !!}
   {!! Form::text('username') !!}
{!! Form::close() !!}

And make sure your view has a blade extension - [view_name].blade.php

Upvotes: 1

Related Questions