2014-03-28 57 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) 
    ); 
?>