Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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:

<?php
{!! 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.