我想在我的应用程序中使用 jQuery Smart Wizard。我已经更新 composer.json 然后运行 composer update。在这里,我将供应商文件夹中的相关文件作为 techlab\smartwizard。
如何从树枝模板链接 css 和 js 文件?我尝试使用以下命令生成资源链接。
php bin\console assets:install --symlink --relative
该命令似乎只处理每个Bundle中resources\Public中的文件夹。我希望我可以使用下面的链接来获取文件。
<link rel="stylesheet" href="{{ asset('bundles/XXX/static//styles/XXX.css') }}">
我知道我可以在web文件夹下创建CSS和JS文件夹,然后在其中复制相关文件。我只是想知道我是否必须手动执行此操作,那么为什么我使用 composer 来安装它。我可以只下载文件并将它们放在目标文件夹中。就这样。
我不确定是否有更好的方法来管理资源。
非常感谢您的帮助。
assets:install
命令仅在它在Resources/public
目录中找到目录/文件时才有效。
我在这里看到两个选项:
1) create a bundle and add the files in the Resources public directory
2) use bower and install this package as a dependency for frontend.
For this, you may create a `.bowerrc` file to set the
target directory which can be `web/bower`.
Composer 用于管理 php 依赖项,而不是前端依赖项,除非有人制作了一个包与 composer 一起工作并集成到框架中。
因此,您可以使用:
1) composer -> php related, backend dependencies
2) bower, npm -> frontend dependencies
我使用带有 gulp 的预编译器来管理项目中的 css、图像和 js 文件
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句