<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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <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>