【问题标题】:CakePHP Paginator Link with Image?CakePHP 分页器与图像的链接?
【发布时间】:2011-07-18 06:44:31
【问题描述】:

我想将 Paginator-Link 与图像结合起来。

要加载我使用的图像:(显示图像,没有任何问题)

$this->Html->image('arrow_up.png');

我的自定义分页器链接:(显示链接,没有任何问题)

$this->Paginator->link('',array('sort' => 'Item.vidduration', 'direction' => 'desc'));

.

.

两者都将显示链接而不显示图片:

$this->Paginator->link($this->Html->image('arrow_up.png', array("alt" => "Duration DESC")),array('sort' => 'Item.vidduration', 'direction' => 'desc'));

输出:

<img src="/img/arrow_up.png" alt="Duration DESC" />

我的错误在哪里?

【问题讨论】:

  • 输出的是一个img标签,但是你说它显示的是链接,没有图片?应该反过来还是我错过了什么?
  • 你应该改用 CSS
  • 是的,应该反过来。我无法使用 CSS,因为我通过 php 调用 Paginator。

标签: image cakephp hyperlink pagination


【解决方案1】:

试试这个

<?php echo $this->Paginator->link($html->image('arrow_up.png', array("alt" => "Duration DESC")),array('sort' => 'Item.vidduration', 'direction' => 'desc'), $options = array('escape' => false)); ?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 1970-01-01
    • 2012-11-26
    • 2015-02-13
    • 1970-01-01
    • 2014-06-05
    • 2010-12-25
    相关资源
    最近更新 更多