2014-03-28 153 views
0
<?php 
     echo $this->Html->link($this->Html->image('files/user/photo/'.$row['User']['photo_dir'].'/'.$row['User']['photo'], array('width' => '200', 'height' => '200')) . ' ' . __('user image'), 
         array('controller'=>'Profiles'), 
         array('escape' => false),$row['User']['id']);?> 

這裏我想這樣的代碼圖像鏈接值

<a href="profiles/index/<?php echo $row['User']['id']; ?>"><img src="files/user/photo/<?php echo ($row['User']['photo_dir']).'/'.($row['User']['photo']);?>" width="200" height="200"/> </a> 

但在蛋糕PHP頁面圖像的URL和圖像名稱不getting..html的作品,但CakePHP的核心代碼不工作

回答

0

試試這個

<?php 
    echo $this->Html->link(
     $this->Html->image('../files/user/photo/'.$row['User']['photo_dir'].'/'.$row['User']['photo'], 
      array(
       'width' => '48', 
       'height' => '48' 
      )), 
     array(
      'controller'=>'Profiles', 
      'action'=>'index', 
      $row['User']['id'] 
     ), 
     array('escape' => false) 
    ); 
?>