首页 > 其他 > 详细

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

时间:2014-01-20 19:58:00      阅读:462      评论:0      收藏:0      [点我收藏+]

问的白一点就是 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)在里面,这些固定的变量不能变,其他的随便你怎么搞都行,有兴趣的话,可以点链接多了解一些,急于解决问题的,往下看

bubuko.com,布布扣
<?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‘,
        ),
    ),
)); ?>
bubuko.com,布布扣

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

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

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

原文:http://www.cnblogs.com/debmzhang/p/3527101.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!