gpt4 book ai didi

laravel - 从 Laravel 5 View 访问供应商文件的简单而干净的方法是什么

转载 作者:行者123 更新时间:2023-12-02 11:57:34 28 4
gpt4 key购买 nike

我已经安装了bootstrap-calendar (使用 Bower)到我的 Laravel 5 项目。 Bootstrap-calendar 已安装到我的 laravel/vendor/bootstrap-calendar/文件夹中。

要使用 bootstrap-calendar,我需要在 View 中引用 CSS/JS 文件,来自:

laravel/vendor/bootstrap-calendar/css
laravel/vendor/bootstrap-calendar/js

是否有一种简单、干净的方法可以在我的项目中使用这些文件,而无需将它们复制到公用文件夹?

最佳答案

您可以使用Laravel Mix (在 Laravel <= 5.3 上称为 Laravel Elixir)以对应用程序的 Assets 执行此功能和其他功能。

Laravel >= 5.4:

mix.copy('vendor/bootstrap-calendar/css', 'public/bootstrap-calendar/css');
mix.copy('vendor/bootstrap-calendar/js', 'public/bootstrap-calendar/js');

Laravel <= 5.3:

elixir(function(mix) {
mix.copy('vendor/bootstrap-calendar/css', 'public/bootstrap-calendar/css');
mix.copy('vendor/bootstrap-calendar/js', 'public/bootstrap-calendar/js');
});

关于laravel - 从 Laravel 5 View 访问供应商文件的简单而干净的方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31528611/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com