How to pass additional parametres to ClistView template

How can I pass additional parameter to template that is used by CListView widget(_view.php template)?

dataProvider is instance of CActiveDataProvider, so I can’t add any additional attributes in data provider(it also doesn’t have sense to add any parameter that doesn’t belong to model to data provider)

$this->widget('zii.widgets.CListView', array(




I want for example to pass $return_url variable to _view, so I can use it there.

Use viewData.

You can use viewData - http://www.yiiframew…viewData-detail

Edit: @zaccaria - same time of posting just milliseconds appart :)

Thank you:) It is working.

Everything is in API docs, for those who knows to read.

@mdomba: I guess you just loss precious time while typing “You can” :)