images php coding issues or problems here.
Moderators: macek, egami, gesf
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)); ?>
<?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.
Who is online
Users browsing this forum: No registered users and 1 guest