Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Laravel 4 Basics Blade & Forms Form Builder

My form is not outputting correctly (Laravel 5)

My form is outputting the HTML. I am using laravel 5, I had to update via composer and then change the app.php.

I am now confused as to why blade is not generating my form?

<form method="POST" action="http://laravel.dev:8000/myers" accept-charset="UTF-8"><input name="_token" type="hidden" value="KZuCvZwOs6NQG9JmPfi9eaI1PqQdfF06NHaMDxvV"> <label for="title">This is the form title</label> <input name="title" type="text" id="title"> <input type="submit" value="Submit Button"> </form>

1 Answer

I ended up fixing the code and it outputs as expected.

I formatted my form as seen below:

{!! Form::open( array('route' => 'todos.store') ) !!}

    {!!  Form::label('title','This is the form title')  !!}
    {!!  Form::text('title')  !!}
    {!!  Form::submit('Submit Button') !!}

{!!  Form::close()  !!}

It worked (I have no css button class as of yet so did not include it)

Great job! In Laravel 5, Blade changed it's echo/escaped echo syntax to avoid confusion between {{ }} and {{{ }}}. The exclamation marks are meant to draw your eye to the code, because it can be dangerous to have unescaped code echo'd to the screen.