bootstraplinkpager

CLinkPager class for Twitter Bootstrap
9 followers

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

Update

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.

Requirements

Tested with Yii 1.1.10

Requires Bootstrap

Usage

Drop the archived file into your 'extensions' folder.

Add this to your config file:

// autoloading model and component classes
'import'=>array(
    //.....
    'ext.bootstraplinkpager.*',
),

In view, use like this:

$this->widget('zii.widgets.grid.CGridView',array(
    '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 3 comments

#9498 report it
apolinux at 2012/08/17 02:26pm
Re: It doesn't works

I could fix the error by myself, as you has recently explained. Thanks anyway.

#9497 report it
outrage at 2012/08/17 01:55pm
Re: It doesn't works

Hi apolinux,

Sorry for the delay in replying, I hope you have fixed it by now. It seems your system isn't finding the file for some reason.

Make sure you unzip the download and place the file within it, into your "protected/extensions/" folder. Follow the rest of the instructions above and you can't go wrong.

If you still have problems, show me your directory structure and I'll try to help.

#9435 report it
apolinux at 2012/08/10 06:02am
It doesn't works

I have done the steps as you explained, but I just got the message

include(bootstraplinkpager.php): failed to open stream: No such file or directory

/var/www/html/yii/framework/YiiBase.php(418)

please help

Leave a comment

Please to leave your comment.

Create extension