Creating Widget With Paging Support

hi friends… as im new to yii with little understanding in yii. could you please help me how to create a widget with pagination support… I know how to create a widget but I dont know to create with pagination… pls help me… thanks in advance…

[color="#006400"]/* moved from Tips, Snippets and Tutorials */[/color]

Dear Friend

The following is one simple implementation without using any dataprovider.

Imagine that I have 12 images(image1,image2,image3,…) in images folder under webapp folder.

i.e) webapp/images/gallery




class ImageWidget extends CWidget



	public function run()




		$pages=new CPagination($count);



















<?php echo CHtml::image($url);?>



$this->widget('CLinkPager', array(

    'pages' => $pages,

    'header'=>'Go to Images'



Now in any view, we can call


I hope this would help you.


thanks… great tutorial

please explain about cpagination with its properties and methods… sorry for any inconvenience…

Dear Friend

I am sure that you know the story of an elephant and five blind men.

Each one interpreting differently by touching different parts of the animal.

Yii is like a big elephant and I am one among the blind.

Best thing is going through the API.



yesterday I tried it friend now I understand the basics of pagination… thanks for ur kind help…

My new personal hero!!!