Cakephp 从图像中排序表

Cakephp 从图像中排序表,cakephp,Cakephp,我有一个列为“read”的表。我希望能够从图形而不是文本中进行排序,尽管我似乎无法解决这个问题 以下是我尝试过的: <!-- none of these work...--> <th class="read"><?php echo $this->Paginator->sort('read',$this->Html->image("read_no.png", array(

我有一个列为“read”的表。我希望能够从图形而不是文本中进行排序,尽管我似乎无法解决这个问题

以下是我尝试过的:

        <!-- none of these work...-->

        <th class="read"><?php echo $this->Paginator->sort('read',$this->Html->image("read_no.png", array(
                    'width' => "26px",
                    'alt' => "Read",
                    array('escape' => false)))); ?></th>

        <th class="read"><?php echo $this->Html->link(
            $this->Html->image("read_no.png", array("alt" => "Read")),
            $this->Paginator->sort('read'),
            array('escape' => false)
        );?></th>

        <th class="read"><?php echo $this->Html->image("read_no.png", array(
                    'width' => "26px",
                    'alt' => "Read",
                    'url' => $this->Paginator->sort('read'),
                    array('escape' => false)
                )); ?>
        </th>

我会遇到如下错误:

        The action <a href=" is not defined in controller

操作您需要将转义选项添加到Paginator/sort方法,而不是HTML/image方法:

<th class="read">
    <?php 
       $imageTag = $this->Html->image("read_no.png", array(
                                                         'width' => "26px",
                                                         'alt' => "Read",
                                                      )
                                      );
       echo $this->Paginator->sort('read', $imageTag, array('escape' => false)); ?>
 </th>


如果您将其设置为文本,它是否工作?是否在控制器中设置分页?