【问题标题】:url() parameter not working in Blade template includeurl() 参数在 Blade 模板中不起作用包括
【发布时间】:2019-10-05 09:47:38
【问题描述】:

我正在使用带有 Blade 模板的 Laravel 5。我的模板如下所示:

drone.blade.php

@include('drone.gallery')

无人机/gallery.php

{{ url('images-gallery/DSC_0072.JPG') }}

但是,url() 函数在我的包含文件中不起作用。如果我将 {{ url('images-gallery/DSC_0072.JPG') }} 行复制到 drone.blade.php 中,它会按预期工作。

为什么 url() 参数在 include 中不起作用?

提前致谢。

【问题讨论】:

    标签: laravel laravel-5 laravel-blade


    【解决方案1】:

    我可以看到你的文件名是gallery.php。

    你能不能把它改成gallery.blade.php

    【讨论】:

    • 这有帮助吗?
    猜你喜欢
    • 1970-01-01
    • 2018-07-18
    • 2021-02-12
    • 2017-08-03
    • 1970-01-01
    • 2017-05-13
    • 2022-01-04
    • 1970-01-01
    • 2012-07-18
    相关资源
    最近更新 更多