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

      <bdo id='f7S9s'></bdo><ul id='f7S9s'></ul>

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

      1. laravel 刀片 @include 不工作

        laravel blade @include not working(laravel 刀片 @include 不工作)
          <bdo id='UuJSr'></bdo><ul id='UuJSr'></ul>

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

            <legend id='UuJSr'><style id='UuJSr'><dir id='UuJSr'><q id='UuJSr'></q></dir></style></legend>

                    <tbody id='UuJSr'></tbody>
                1. <tfoot id='UuJSr'></tfoot>
                2. <i id='UuJSr'><tr id='UuJSr'><dt id='UuJSr'><q id='UuJSr'><span id='UuJSr'><b id='UuJSr'><form id='UuJSr'><ins id='UuJSr'></ins><ul id='UuJSr'></ul><sub id='UuJSr'></sub></form><legend id='UuJSr'></legend><bdo id='UuJSr'><pre id='UuJSr'><center id='UuJSr'></center></pre></bdo></b><th id='UuJSr'></th></span></q></dt></tr></i><div id='UuJSr'><tfoot id='UuJSr'></tfoot><dl id='UuJSr'><fieldset id='UuJSr'></fieldset></dl></div>
                3. 本文介绍了laravel 刀片 @include 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用刀片语法在我的主页中包含文件:-

                  I am trying to include files in my homepage using blade syntax :-

                  @foreach($data as $articles)
                      @include(app_path().$articles->path)
                      <br />
                  @endforeach
                  

                  这不起作用.

                  错误提示:-

                  View [/var/www/blogproject/project/app/pages/articles/first-post.php] not found
                  

                  我什至尝试只包含第一页:-

                  I even tried including just the first page :-

                  @include(app_path().'/pages/articles/first-post.php')
                  

                  但正常的 php 包含工作正常:-

                  But the normal php include is working fine :-

                  <?php include(app_path().'/pages/articles/first-post.php'); ?>
                  

                  请帮忙

                  推荐答案

                  那是因为该文件不在 app/views 目录中.当您调用 @include('filename') 时,Blade 会自动在 apps/views 目录中查找任何具有该名称的文件.此外,您不应该编写文件扩展名,因为 Blade 会自动查找具有 .blade.php.php 扩展名的文件.

                  That's because that file is not in the app/views directory. When you call @include('filename'), Blade automatically looks for any file with that name, inside the apps/views directory. Also, you're not supposed to write the file extension, as Blade automatically looks for files with .blade.php and .php extensions.

                  如果您想在 @include 标记上使用其他目录中的文件,请将目录添加到 app/config/view.php 上的路径数组中.在你的情况下,它会是这样的:

                  If you want to use files from other directories on the @include tag, add the directory to the paths array, on app/config/view.php. In your case, it'd be something like this:

                  app/config/view.php

                  <?php
                  
                      // ...
                  
                      'paths' => array(
                          __DIR__.'/../views',
                          __DIR__.'/../pages'
                      );
                  

                  然后,你会在 Blade 上这样称呼它:

                  Then, you'd call it on blade like so:

                  @include('articles/first-post')
                  

                  这篇关于laravel 刀片 @include 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)

                  <small id='6tCOW'></small><noframes id='6tCOW'>

                    <tbody id='6tCOW'></tbody>
                    <bdo id='6tCOW'></bdo><ul id='6tCOW'></ul>

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

                      1. <legend id='6tCOW'><style id='6tCOW'><dir id='6tCOW'><q id='6tCOW'></q></dir></style></legend>