CakePHP: image inside link, want to make link point to image location

后端 未结 2 796
眼角桃花
眼角桃花 2021-01-15 20:34

I have some images inside links that I want to essentially look like this:



        
相关标签:
2条回答
  • 2021-01-15 21:11

    This should do the trick:

    echo $html->image('image.png', array('url' => '/' . IMAGES_URL . 'image.png'));
    
    0 讨论(0)
  • 2021-01-15 21:11

    you can also do this in 1.2

    echo $html->link(
        $html->image('img.png'),
        'img.png',
        array(),
        null, 
        false
      );
    

    or in 1.3

    echo $html->link(
        $html->image('img.png'),
        'img.png',
        array(),
        array( 'escape' => false ),     
      );
    
    0 讨论(0)
提交回复
热议问题