zoukankan      html  css  js  c++  java
  • 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}条记录',

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

  • 相关阅读:
    TCP同步与异步
    C#委托与事件
    线程
    C# 多人聊天程序
    vs启动错误
    记住我的痛苦
    C#命名空间与类名的冲突
    C#调试类
    linux ifconfig命令参数及用法详解linux查看配置网卡命令
    B/S架构
  • 原文地址:https://www.cnblogs.com/debmzhang/p/3527101.html
Copyright © 2011-2022 走看看