我将图像声明为
  <?php echo $this->Html->image('buttonaft.png', array('alt'=> __('img', true), 'border' => '0'));  ?>
在 cakephp 中默认读取的 javascript 文件中。
该代码无法读取图像。
我将图像声明为
  <?php echo $this->Html->image('buttonaft.png', array('alt'=> __('img', true), 'border' => '0'));  ?>
在 cakephp 中默认读取的 javascript 文件中。
该代码无法读取图像。
试着给这样..
但请确保您提供正确的路径。
echo $html->image('image.png', array('url' => '/' . IMAGES_URL . 'image.png'));
您也可以在 1.2 中执行此操作
echo $html->link(
    $html->image('img.png'),
    'img.png',
    array(),
    null, 
    false
  );
或在 1.3
echo $html->link(
    $html->image('img.png'),
    'img.png',
    array(),
    array( 'escape' => false ),     
  );