<tfoot id='c5E4U'></tfoot>
    <bdo id='c5E4U'></bdo><ul id='c5E4U'></ul>

      <legend id='c5E4U'><style id='c5E4U'><dir id='c5E4U'><q id='c5E4U'></q></dir></style></legend>
      1. <i id='c5E4U'><tr id='c5E4U'><dt id='c5E4U'><q id='c5E4U'><span id='c5E4U'><b id='c5E4U'><form id='c5E4U'><ins id='c5E4U'></ins><ul id='c5E4U'></ul><sub id='c5E4U'></sub></form><legend id='c5E4U'></legend><bdo id='c5E4U'><pre id='c5E4U'><center id='c5E4U'></center></pre></bdo></b><th id='c5E4U'></th></span></q></dt></tr></i><div id='c5E4U'><tfoot id='c5E4U'></tfoot><dl id='c5E4U'><fieldset id='c5E4U'></fieldset></dl></div>

        <small id='c5E4U'></small><noframes id='c5E4U'>

        Laravel 在 Blade 模板中转义所有 HTML

        Laravel Escaping All HTML in Blade Template(Laravel 在 Blade 模板中转义所有 HTML)

          • <bdo id='ZzuKL'></bdo><ul id='ZzuKL'></ul>

            1. <small id='ZzuKL'></small><noframes id='ZzuKL'>

                <tbody id='ZzuKL'></tbody>

                <legend id='ZzuKL'><style id='ZzuKL'><dir id='ZzuKL'><q id='ZzuKL'></q></dir></style></legend>
              • <i id='ZzuKL'><tr id='ZzuKL'><dt id='ZzuKL'><q id='ZzuKL'><span id='ZzuKL'><b id='ZzuKL'><form id='ZzuKL'><ins id='ZzuKL'></ins><ul id='ZzuKL'></ul><sub id='ZzuKL'></sub></form><legend id='ZzuKL'></legend><bdo id='ZzuKL'><pre id='ZzuKL'><center id='ZzuKL'></center></pre></bdo></b><th id='ZzuKL'></th></span></q></dt></tr></i><div id='ZzuKL'><tfoot id='ZzuKL'></tfoot><dl id='ZzuKL'><fieldset id='ZzuKL'></fieldset></dl></div>
                <tfoot id='ZzuKL'></tfoot>
                  本文介绍了Laravel 在 Blade 模板中转义所有 HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在 Laravel 中构建一个小型 CMS,并尝试显示内容(存储在数据库中).它显示 HTML 标签而不是执行它们.就像所有打印数据都有一个自动 html_entity_decode 一样.

                  I'm building a small CMS in Laravel and I tried to show the content (which is stored in the DB). It is showing the HTML tags instead of executing them. Its like there is an auto html_entity_decode for all printed data.

                  <?php
                  
                  class CmsController extends BaseController
                  {
                      public function Content($name)
                      {    
                          $data = Pages::where('CID', '=', Config::get('company.CID'))
                              ->where('page_name', '=', $name)
                              ->first();
                  
                          return View::make('cms.page')->with('content', $data);
                      }
                  }
                  

                  我尝试使用花括号打印内容.

                  I tried to print the content using the curly brace.

                  {{ $content->page_desc }}
                  

                  和三重花括号.

                  {{{ $content->page_desc }}}
                  

                  他们给出了相同的结果.我需要执行那些 HTML 标签而不是转义它们.

                  And they give the same result. I need to execute those HTML tags instead of escaping them.

                  推荐答案

                  将语法从 {{ }} 更改为 {!!!!}.

                  Change your syntax from {{ }} to {!! !!}.

                  正如 Alpha 在上面的评论中所说(不是答案,所以我想我会发布),在 Laravel 5 中,{{ }}(以前是非转义的输出语法)已经改变到 <代码>{!!!!}.将 {{ }} 替换为 {!!!!} 它应该可以工作.

                  As The Alpha said in a comment above (not an answer so I thought I'd post), in Laravel 5, the {{ }} (previously non-escaped output syntax) has changed to {!! !!}. Replace {{ }} with {!! !!} and it should work.

                  这篇关于Laravel 在 Blade 模板中转义所有 HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Laravel 4 - Connect to other database(Laravel 4 - 连接到其他数据库)
                  Call external API function from controller, LARAVEL 4(从控制器调用外部 API 函数,LARAVEL 4)
                  Empty string instead of null values Eloquent(空字符串而不是空值 Eloquent)
                  quot;laravel.logquot; could not be opened: failed to open stream(“laravel.log无法打开:无法打开流)
                  Displaying the Error Messages in Laravel after being Redirected from controller(从控制器重定向后在 Laravel 中显示错误消息)
                  Laravel Creating Dynamic Routes to controllers from Mysql database(Laravel 从 Mysql 数据库创建到控制器的动态路由)
                  <legend id='IhQdr'><style id='IhQdr'><dir id='IhQdr'><q id='IhQdr'></q></dir></style></legend>
                    <tfoot id='IhQdr'></tfoot>

                          <tbody id='IhQdr'></tbody>
                        • <small id='IhQdr'></small><noframes id='IhQdr'>

                            <bdo id='IhQdr'></bdo><ul id='IhQdr'></ul>
                            <i id='IhQdr'><tr id='IhQdr'><dt id='IhQdr'><q id='IhQdr'><span id='IhQdr'><b id='IhQdr'><form id='IhQdr'><ins id='IhQdr'></ins><ul id='IhQdr'></ul><sub id='IhQdr'></sub></form><legend id='IhQdr'></legend><bdo id='IhQdr'><pre id='IhQdr'><center id='IhQdr'></center></pre></bdo></b><th id='IhQdr'></th></span></q></dt></tr></i><div id='IhQdr'><tfoot id='IhQdr'></tfoot><dl id='IhQdr'><fieldset id='IhQdr'></fieldset></dl></div>