yii 自动生成的内容,分页信息(Displaying 1-10 of 15 results.)如何修改或是yii cgridview template summary...

问的白一点就是 Displaying 1-10 of 15 results 如何翻译

如果搜索的话, 搜这个会出来很多内容 yii cgridview template summary

好了,其他不说了,说下如何解决,解决前,先看一段官方介绍

http://www.yiiframework.com/doc/api/1.1/CBaseListView#summaryText-detail

参考:http://www.yiiframework.com/forum/index.php/topic/45752-modify-cgridview-template-summary/

打开慢的朋友,看下边我摘出来的就行了

summaryText property
public string $summaryText;

the summary text template for the view. These tokens are recognized and will be replaced with the corresponding values:

  • {start}: the starting row number (1-based) currently being displayed
  • {end}: the ending row number (1-based) currently being displayed
  • {count}: the total number of rows
  • {page}: the page number (1-based) current being displayed, available since version 1.1.3
  • {pages}: the total number of pages, available since version 1.1.3

按我的意思来理解,其实,这就是一个模板(template),里面提供了一些固定的变量(start,end,count,page,pages)在里面,这些固定的变量不能变,其他的随便你怎么搞都行,有兴趣的话,可以点链接多了解一些,急于解决问题的,往下看

<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'mv-film-chart-grid',
    'dataProvider'=>$model->search(),
    'filter'=>$model,
    'summaryText' => '显示{start}-{end},一共{count}条记录',
    'columns'=>array(
        'id',
        'vid',
        'paixu',
        'show_time',
        array(
            'class'=>'CButtonColumn',
        ),
    ),
)); ?>

'summaryText' => '显示{start}-{end},一共{count}条记录',

嗯,就是它了,加上,保存,再刷新看下吧  :)

 

转载于:https://www.cnblogs.com/debmzhang/p/3527101.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值