<i id='0zEaf'><tr id='0zEaf'><dt id='0zEaf'><q id='0zEaf'><span id='0zEaf'><b id='0zEaf'><form id='0zEaf'><ins id='0zEaf'></ins><ul id='0zEaf'></ul><sub id='0zEaf'></sub></form><legend id='0zEaf'></legend><bdo id='0zEaf'><pre id='0zEaf'><center id='0zEaf'></center></pre></bdo></b><th id='0zEaf'></th></span></q></dt></tr></i><div id='0zEaf'><tfoot id='0zEaf'></tfoot><dl id='0zEaf'><fieldset id='0zEaf'></fieldset></dl></div>
      <tfoot id='0zEaf'></tfoot>

        <bdo id='0zEaf'></bdo><ul id='0zEaf'></ul>
      1. <small id='0zEaf'></small><noframes id='0zEaf'>

        <legend id='0zEaf'><style id='0zEaf'><dir id='0zEaf'><q id='0zEaf'></q></dir></style></legend>

        如何在 Yii 中自定义寻呼机的标签?

        How can I customize the labels for the pager in Yii?(如何在 Yii 中自定义寻呼机的标签?)

            <bdo id='zm9w4'></bdo><ul id='zm9w4'></ul>

                <small id='zm9w4'></small><noframes id='zm9w4'>

                    <tbody id='zm9w4'></tbody>
                  <i id='zm9w4'><tr id='zm9w4'><dt id='zm9w4'><q id='zm9w4'><span id='zm9w4'><b id='zm9w4'><form id='zm9w4'><ins id='zm9w4'></ins><ul id='zm9w4'></ul><sub id='zm9w4'></sub></form><legend id='zm9w4'></legend><bdo id='zm9w4'><pre id='zm9w4'><center id='zm9w4'></center></pre></bdo></b><th id='zm9w4'></th></span></q></dt></tr></i><div id='zm9w4'><tfoot id='zm9w4'></tfoot><dl id='zm9w4'><fieldset id='zm9w4'></fieldset></dl></div>
                  <tfoot id='zm9w4'></tfoot>

                1. <legend id='zm9w4'><style id='zm9w4'><dir id='zm9w4'><q id='zm9w4'></q></dir></style></legend>
                  本文介绍了如何在 Yii 中自定义寻呼机的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 Yii 的新手.我想实现自定义分页.我想更改寻呼机的外观.如何更改寻呼机链接的标签?

                  I am new to Yii. I want to implement custom pagination. I want to change the appearance of the pager. How do I change the labels of the pager's links?

                  我希望链接看起来像这样:

                  I want the links to appear like so:

                  <<  <  1  2  3  4  >  >>
                  

                  而不是它们的默认外观,如下所示:

                  instead of their default appearance, which is like this:

                  [first] [previous]  1  2  3  4  [next] [last]
                  

                  我使用 CListView 来显示数据,我已经这样设置了:

                  I am using CListView to display the data, which I have set up like this:

                  $this->widget('zii.widgets.CListView', array(
                              'dataProvider' => $categoryProjects,
                              'itemView' => '_itemDetailsView',           
                              'ajaxUpdate'=>false,
                          ));
                  

                  谁能告诉我如何开始?我看过一些帖子,但无法获得正确的信息.

                  Can anyone please tell me how do I start with it? I've seen some posts but unable to get right information.

                  提前致谢.

                  推荐答案

                  你需要设置CListViewpager 属性.默认情况下,这是一个 CLinkPager;您不需要更改它(此组件已满足您的需求),但您需要对其进行配置:

                  You need to set the pager property of the CListView. By default, this is a CLinkPager; you don't need to change that (this component has your needs covered), but you need to configure it:

                  $this->widget('zii.widgets.CListView', array(
                              'dataProvider' => $categoryProjects,
                              'itemView'     => '_itemDetailsView',
                              'ajaxUpdate'   => false,
                              'pager'        => array(
                                                  'class'          => 'CLinkPager',
                                                  'firstPageLabel' => '<<',
                                                  'prevPageLabel'  => '<',
                                                  'nextPageLabel'  => '>',
                                                  'lastPageLabel'  => '>>',
                                                ),
                          ));
                  

                  更新:如果您想将上述自定义配置融入"到您应用程序中的所有列表视图中,您必须创建一个新的 CustomListView 组件,该组件来自 CustomListView代码>CListView.所以你需要这个类:

                  Update: If you want to "bake in" the above custom configuration to all list views in your application, you have to create a new CustomListView component deriving from CListView. So you need this class:

                  Yii::import('zii.widgets.CListView');
                  
                  class CustomListView extends CListView {
                      public function init() {
                          parent::init();
                  
                          $this->pager = array( 
                                              'class'          => 'CLinkPager', 
                                              'firstPageLabel' => '<<', 
                                              'prevPageLabel'  => '<', 
                                              'nextPageLabel'  => '>', 
                                              'lastPageLabel'  => '>>', 
                                         );
                      }
                  }
                  

                  包含此内容后,您可以简单地使用 CustomListView 作为列表小部件而不是 zii.widgets.CListView.

                  After including this, you can simply use CustomListView as your list widget instead of zii.widgets.CListView.

                  这篇关于如何在 Yii 中自定义寻呼机的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                    <tbody id='qL2LV'></tbody>
                  <i id='qL2LV'><tr id='qL2LV'><dt id='qL2LV'><q id='qL2LV'><span id='qL2LV'><b id='qL2LV'><form id='qL2LV'><ins id='qL2LV'></ins><ul id='qL2LV'></ul><sub id='qL2LV'></sub></form><legend id='qL2LV'></legend><bdo id='qL2LV'><pre id='qL2LV'><center id='qL2LV'></center></pre></bdo></b><th id='qL2LV'></th></span></q></dt></tr></i><div id='qL2LV'><tfoot id='qL2LV'></tfoot><dl id='qL2LV'><fieldset id='qL2LV'></fieldset></dl></div>

                    • <bdo id='qL2LV'></bdo><ul id='qL2LV'></ul>
                    • <tfoot id='qL2LV'></tfoot>
                            <legend id='qL2LV'><style id='qL2LV'><dir id='qL2LV'><q id='qL2LV'></q></dir></style></legend>

                            <small id='qL2LV'></small><noframes id='qL2LV'>