title: Undefined variable: dataProvider
body: <p>I am new to Yii. while I was passing the dataprovider to a view its getting error as Undefined variable dataProvider. </p>
  
  <h3>SiteController code</h3>
  
  <pre><code>elseif ($id=='user')  
  {  
      $dataProvider=new CActiveDataProvider('Product');
      $this-&gt;redirect(array('site/userhome'),array('dataProvider'=&gt;$dataProvider));  
  }
  </code></pre>
  
  <h3>userhome code</h3>
  
  <pre><code>&lt;?php $this-&gt;widget('zii.widgets.CListView', array(
  'dataProvider'=&gt;$dataProvider,
  'itemView'=&gt;'_view')); ?&gt;
  </code></pre>