how to create a linked image?

images php coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
bltaug3

how to create a linked image?

Post by bltaug3 » Tue Oct 26, 2010 6:56 am

I'm working off previously created php coding, and am trying to figure out how to change a text link to an image. The code uses the link function, so I can't figure how what variable I can put in to get the image to show properly. The function of the button is a next/previous link for a catalog of products. Here's the current code:

Code: Select all

<?php echo $this->Html->link('<< Previous Product',array('controller'=>'products','action'=>'view', $product['Product']['id']-1)); ?>
<br/>
<?php echo $this->Html->link('Next Product >>',array('controller'=>'products','action'=>'view', $product['Product']['id']+1)); ?>
I tried declaring a variable $prevbtn equal to <img src="http..."> and replacing the current '<< Previous Product' with that $prevbtn but that just displays the html src code.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests