在cakephp中添加图像src路径

时间:2013-06-22 06:55:05

标签: html cakephp hyperlink

我在使用html标签在cakephp中创建了一个图像链接,我在添加src路径时遇到了问题。

我试过

<a href="#today1" id="lnk3">
 <img  src="/iserprofiles/app/webroot/img/todaysallocation.png">Todays Allocation</a>

但未加载图片。如果有人知道请回复。我知道我们也可以使用cakephp创建图像链接,但我遇到了一个问题

我使用此代码

  <?php echo $this->Html->link($this->Html->image('todaysallocation.png',
  array('width' => '200', 'height' => '45')) ,
                   '#today',array('escape' => false));?>

我不想使用任何控制器或动作作为网址,只是我添加了'#today', 但我的问题是我需要为此添加一个id。我们怎么能这样做????

1 个答案:

答案 0 :(得分:1)

签入您的浏览器补丁:localhost/iserprofiles/app/webroot/img/todaysallocation.png ,但我认为问题出在你的.htaccess文件中,因为图片的路径看起来像localhost/iserprofiles/img/todaysallocation.png