为什么我的 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') !!}
所以我写了如下路由:
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') !!}