How to get data of a CActiveDataProvider in view/layout/Main.php

Hey,

I want to put the content of a CActiveDataProvider in the footer of my view/layout/Main.php file.

Can anybody tell me where to create CActiveDataProvider Object since it doesn’t depend on any special controller or do I have to create the CActiveDataProvider Object in the view itself?

Hope this is understandable

THX

Andreas

I don’t know what is the best way to do this but here is my idea:

put the code in components/Controller.php

(assuming that your controllers extend that Controller class instead of the CController)

you can create a function and then return the value when you call it

Or create a widget class, instantiate the dataprovider in its run() method and use widget’s own view to display the result.

Yeah I’m going for the widget class !

THX