title: how to put confirm alert in controller and redirect to perticular link if cancel it in yii
body: <p>i want to put confirm alert in controller and redirect to perticular link if cancel button clicked.
  My admin.php code is:</p>
  
  <pre><code>         array(
              'header' =&gt; 'Action',
              'class' =&gt; 'CButtonColumn',
              'template' =&gt; '{update}',
              'updateButtonUrl' =&gt; 'Yii::app()-&gt;createUrl("attendance/inout", array("id"=&gt;$data-&gt;supplier_master_id))'
           )
  </code></pre>
  
  <p>Here i have to put confirm alert in controller because some extra condition also put in it.</p>
  
  <p>My controller code is:</p>
  
  <pre><code>public function actionInout($id) { 
  ?&gt;
  &lt;script&gt; 
  if(confirm("Do you want to add record?")) {
    // means proceed
  } else {         
    // Should be redirect back to the grid view
  } 
  &lt;/script&gt;
  &lt;?php // further code
  </code></pre>