我正在使用 symfony 2、composer 和 sass 框架
我在 MYBundle/Resources/public/ 下有名为 files/ 和 images/ 的额外文件夹
出于某种原因,当我运行命令时,此文件或图像文件夹未在 web/ .. 下创建:
php 应用程序/控制台资产:安装
但是他们确实在 web/bundles/mybundle/files..
与图像文件夹相同:web/bundles/mybundle/images..
我只有这些文件夹..在网络下..
web/
bundles/
css/
js/
如何在 web/ 下获取我的另外两个文件夹,它们是图像和文件文件夹...
像这样..
web/
bundles/
images/
css/
js/
files/
因为我需要在文件/文件夹中保留一些文件,例如termsandconditions.pdf..
我在 config.yml 中的配置是:
# Assetic Configuration
parameters:
# Assetic
assetic.filter.compass.images_dir: %kernel.root_dir%/../web/images
assetic.filter.compass.http_path: /images
assetic.filter.compass.images_dir: %kernel.root_dir%/../web/files
assetic.filter.compass.http_path: /files
assetic:
debug: %kernel.debug%
use_controller: false
filters:
sass: ~
compass: ~
cssrewrite: ~
树枝文件中的路径是:
<div class="small-4 columns">
<p>I accept the <a href="{{ asset('/files/terms_and_conditions.pdf') }}" target="_blank"><span class="pinkText">Terms and Conditions</span></a></p>
</div>
如果有人知道步骤,请告诉我...我对 Symfony 很熟悉