【发布时间】:2018-07-04 06:05:05
【问题描述】:
//index.html.php
<?php foreach ($view['assetic']->image(
array('@AppBundle/Resources/public/images/test.png')
) as $url): ?>
<div id="title">
<h1><a href="/home/#"><img alt="logo" src="<?php
echo $view->escape($url); ?>"> </a>
</h1>
</div>
<?php endforeach ?>
上面是我添加后模板中的代码,我执行了 assetic:dump 并在 web/images/ 中生成了一个图像,仍然我无法在我的页面上看到图像。它为图像引发 404 错误。 请让我知道这里出了什么问题。
注意:尝试在 assets.yml 和 LiipImagineBundle 中指定图像路径,但没有任何帮助。
【问题讨论】:
标签: image symfony model-view-controller assetic symfony-3.4