Iam使用html标签在cakephp中创建图片链接,我在添加src路径时遇到了问题。在cakephp中添加image src路径
我试图
<a href="#today1" id="lnk3">
<img src="/iserprofiles/app/webroot/img/todaysallocation.png">Todays Allocation</a>
,但没有加载图像。如果有人知道,请回复。我知道,我们也可以使用CakePHP创建图像链接,但我遇到一个问题
IU的sed这个代码
<?php echo $this->Html->link($this->Html->image('todaysallocation.png',
array('width' => '200', 'height' => '45')) ,
'#today',array('escape' => false));?>
我不希望使用任何控制器或行动网址,只需我只是说“#今天', 但我的问题是我需要为此添加一个ID。我们怎么能做到这一点?
我建议使用当地environent合适的虚拟主机设置(HTTP ://www.dereuromark.de/2011/05/29/working-with-domains-locally/)。然后你的'Html->图像'('todaysallocation.png')'会产生一个正确的src路径'/ img/todaysallocation.png',然后一旦你部署到活动服务器,它也能正常工作。 – mark