2010-08-26 42 views
1

我有这样的代码从HTML以前箭头编码器CakePHP的分页与图片

<img src="<?=$this->webroot?>img/arrow_button_prev.png" alt="Previous Event" 
     style="opacity:1.0;filter:alpha(opacity=100); " onmouseover="this.style.opacity=0.7;this.filter.alpha.opacity=70" 
     onmouseout="this.style.opacity=1.0;this.filter.alpha.opacity=100" /> 

,我需要的是像RIGG到分页

<?php echo $this->Paginator->prev('<< ' , array(), null, array('class'=>'disabled'));?> 

我试图与IMG更换< <标记并输出HTML代码。我怎样才能做到这一点?

+0

我会建议你的风格移动到CSS文件。 – bancer 2010-08-27 18:27:03

回答

7

试试这个:

<?php 
echo $this->paginator->prev($html->image('arrow_button_prev.png'), array('escape' => false), null, array('class'=>'disabled')); 
?> 
+0

这在此处的选项部分进行了说明 http://book.cakephp.org/view/1459/Methods S – 2010-08-27 00:14:48

0

你将需要设置 “逃生”=> false,以防止被转义图像标签。

1

尝试此CakePHP的1.3: 例如:上一个按钮:

<?php 
    $prev_img = $html->image("button/compare-slider-btn-l.png", array("width" => "31px", "height" => "90px", "id" => "cmp_slider_click_l")); 
    echo $this->Paginator->prev(!$this->Paginator->hasPrev() ? null : $prev_img, array('escape' => false), !$this->Paginator->hasPrev() ? __($prev_img, false) : null, array('class'=>'disabled')); 
?>