3

So I have written the following route:

Route::get('/login', function() {
    return View::make('login.form');
});

This is the view:

@extends('layouts.master')

@section('content')
    <div class="form-section">
        {{ Form::open(
                array(
                    'url' => 'login-submit',
                    'method' => 'POST'
                )
            )
        }}

            {{ Form::submit('Authorize With AisisPlatform') }}
        {{ Form::close() }}
@stop

This is exactly what I see when I look at the page:

<form method="POST" action="http://app-response.tracking/login-submit" accept-charset="UTF-8"><input name="_token" type="hidden" value="7xHzX20h1RZBnkTP2CRraZVsAfSQIfVP61mBiFtN"> <input type="submit" value="Authorize With AisisPlatform"> </form>

Um..... Shouldn't the form be well .... and actual form? Why did it render out the html as a string? How do I make it render the actual form submit button?

Archy Will He 何魏奇
  • 9,589
  • 4
  • 34
  • 50
TheWebs
  • 12,470
  • 30
  • 107
  • 211

1 Answers1

5

The default echo braces: {{ ... }} escape HTML by default, to prevent HTML injection.

You should use {!! .. !!} to print raw HTML. For example:

{!! Form::submit('Authorize With AisisPlatform') !!}
lukasgeiter
  • 147,337
  • 26
  • 332
  • 270