0

html代码如下:

<div class="hs-item set-bg" data-setbg="bg.jpg"></div>

我想在 cakephp 3 中显示 data-setbg 上方的图像

我努力了:

<?php $URL = WWW_ROOT."img/bg.jpg"; ?>
<div class="hs-item set-bg" data-setbg="<?php echo $URL; ?>"></div>

<div class="hs-item set-bg" data-setbg="<?php echo $this->Html->image('bg.jpg'); ?>"></div>
4

1 回答 1

0

我找到了我的问题的答案

我的问题是在 data-setbg 属性中显示图像

答案是

于 2019-09-15T09:45:47.320 回答