title: How to pass data from a view to a controller - yii
body: <p>I've created a form using the standard yii crud system that holds all of the "paylists" on a certain account. Within each of the paylists there are certain recipients. (i.e. john might be in the paylist for "workers in march", while suzy would be in the pay list "workers in may"). I am trying to create a button in _view.php that allows me to redirect to the recipient page <em>and</em> passes in the information of which list he choice (Which I call list_id). </p>
  
  <p>I've been trying to do this all within the view with a link. This is in _view.php </p>
  
  <pre><code>&lt;?php 
  $list_id = $data-&gt;id;
  echo CHtml::link('Manage',array('recipient/index', 'list_id'=&gt;$list_id)); 
  ?&gt; 
  </code></pre>
  
  <p>But, in my controller I am unable to call $list_id. Should I be doing this in a different way? Should  I be trying to pass data from my view to my controller at all? </p>
  
  <p><strong>___________________</strong> <em>EDIT</em> </p>
  
  <p>The controller looks like this after the edits suggested </p>
  
  <pre><code>public function actionIndex($list_id)
      {
          // echo $_GET["id"];
          $dataProvider= new CActiveDataProvider('Recipient', array('criteria'=&gt;array(
                                                  'condition'=&gt;'list_id = '.$list_id)));
          $this-&gt;render('index',array(
              'dataProvider'=&gt;$dataProvider,
          ));
      }
  </code></pre>