为什么我的laravel 5渲染html作为字符串而不是dom


Why is my laravel 5 rendering html as string instead of dom?

所以我写了下面的路由:

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

这是视图:

@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

这就是我看到的页面:

<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>

嗯…表格应该是....实际形式呢?为什么它把html呈现为字符串?我如何使它呈现实际的表单提交按钮?

默认的回花括号:{{ ... }}默认转义HTML,以防止HTML注入。

您应该使用{!! .. !!}来打印原始HTML。例如:

{!! Form::submit('Authorize With AisisPlatform') !!}