Dataprovider Looping


I am trying to loop through a dataProvider and display data inside using an external JQuery widget.

I have the following in my controller:

	public function actionNav()


		$dataProvider=new CActiveDataProvider('Rabbitsection');





and the view has the following:

                <div style='margin-top: 2px;'>

                     <?php foreach($dataProvider as $rs): ?>

                    <div style='margin-left: 4px; float: left;'>

                        <?php echo CHtml::encode($rs->RabbitSectionName); ?></div>

                    <?php endforeach ?>


RabbitSectionName is a field within the model.

Whn I run this I get the following error: Trying to get property of non-object.

I have missed something somewhere but I can’t see it.

Any help please?