itemView in CListView

Hi,

I’m running into a probably stupid problem, but I cannot find a nice solution for it.

I have widgets/someWidget.php, having a class SomeWidget, that calls


$this->widget('zii.widgets.CListView, array(..., 'itemView' => 'something'));

Now CListView uses CWidget’s getViewPath() to figure out that the view path is ‘/path/to/project/protected/widgets/views’ because it was called from ‘/path/to/project/protected/widgets/someWidget.php’. I don’t understand the logic behind this, and I don’t want it since my view resides in ‘/path/to/project/protected/views/something.php’.

For some reason viewPath is read-only, so I cannot escape the jail that CListView sets up for me…

Is there some decent solution without extending CListView?

Thanks!

Lupin

Try this:


$this->widget('zii.widgets.CListView', array(..., 'itemView' => 'application.rest.of.path.to.view'));

This from here:

http://www.yiiframework.com/doc/api/1.1/CWidget#getViewFile-detail

I can’t believe I did not see that all these times I read the documentation and the source. Thanks you very much!

Lupin