作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
默认情况下,当您在分页中点击排序字段时,它会先升序排序,有没有办法将其设置为先降序?
<th><?php echo $this->Paginator->sort('Views', 'views'); ?></th>
我希望我的用户在点击“查看排序”后首先看到“查看最多”,而不是“查看最少”。
最佳答案
要将默认排序方向设置为降序,请将上面的代码更改为:
<th><?php echo $this->Paginator->sort('Views', 'views, array('direction' => 'desc')); ?></th>
激活后,排序方向将照常在降序和升序之间切换。
关于php - cakephp分页排序先降序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8364537/
我是一名优秀的程序员,十分优秀!