We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: bootstraplinkpager

CLinkPager class for Twitter Bootstrap

Very simple extension to CLinkPager to output the correct CSS when using Twitter Bootstrap.


So short sighted of me. In my rush for a quick solution for a specific problem, I neglected to think of the wider picture.

This could have been an extension to allow you to declare your own CSS classes.

I'm really short on time right now so there's a challenge! Go create the perfect CLinkPager extension.


Tested with Yii 1.1.10

Requires Bootstrap


Drop the archived file into your 'extensions' folder.

Add this to your config file:

// autoloading model and component classes

In view, use like this:

    'dataProvider' => $dataProvider,
    'cssFile' => false, //prevent Yii autoloading css
    'itemsCssClass' => 'table table-striped', // override default css
    'pagerCssClass' => 'pagination', // override default css
    'summaryCssClass' => 'alert alert-info', // override default css
    'pager' => array(
        'class' => 'bootstraplinkpager', // **use extended CLinkPager class**
        'cssFile' => false, //prevent Yii autoloading css
        'header' => false, // hide 'go to page' header
        'firstPageLabel' => '<<', // change pager button labels
        'prevPageLabel' => '<',
        'nextPageLabel' => '>',
        'lastPageLabel' => '>>',

Total 1 comment

#15515 report it
zdzisius at 2013/11/17 04:59pm
PHP notice: Undefined variable: dataProvider

'dataProvider' => $dataProvider,

Leave a comment

Please to leave your comment.

Create extension