Monday, January 23, 2012

create link on image in cake php

Displaying a image in cakephp 
 
<?php echo $html->image('home.gif');?>
 
Create a link in cake php
<?php echo $html->link("Home", array('action' => 'features'),
array('escape' => false));?>
so when we talk about create a link on image we can combine both of these
echo $html->link(
    $html->image('img.png'),
    'img.png',
    array(),
    array( 'escape' => false ),     
  );
 
 
Obvious img.png is image name You have to set the path by default it goes webroot/img/
 
 
 
  • <?php echo $html->link($html->image("products.gif"), array('controller'=>'products', 'action' => 'features'), array('escape' => false));?>
 
 

3 comments:

  1. thanks dude its great information many time we getting difficulty in code i hope you may help me.
    ________________
    Advance Php Training in Jaipur

    ReplyDelete
  2. I actually enjoyed reading through this posting.Many thanks.





    PHP Training in Chennai

    ReplyDelete
  3. php is open source scripting language. php is hypertext pre-processor. it is easily available on internet and provides so many features by which anyone can implement their imaginations in reality.



    ____________________
    best php training in jaipur

    ReplyDelete