title: get Current request referer URL and parse it
body: <p>i have a view (grid) which is used as a rendepatial. this renderpartial grid is used in two actions.</p>
  
  <pre><code>&lt;div id="activities"&gt;&lt;?php echo $this-&gt;renderPartial('grid', array('model'=&gt;$model)); ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>i would need to know how can i check which action is requesting now ? i need to stop some scripts generating from yii and add some scripts when action is 'default/index/' (i mean the call is coming from default/index/) this could also be called from this way ... search/default/index/area/act?query=</p>
  
  <p>action A - <a href="http://mylocalurl.com/ijob-css/index.php/search/default/index/area/act?query=" rel="nofollow">http://mylocalurl.com/ijob-css/index.php/search/default/index/area/act?query=</a></p>
  
  <p>action B - <a href="http://mylocalurl.com/ijob-css/index.php/activities/default/index/" rel="nofollow">http://mylocalurl.com/ijob-css/index.php/activities/default/index/</a></p>
  
  <p>for action b only i need to add some scripts and wondering how this can be done in yii ?</p>
  
  <p>is there something like this available in yii ? <code>if(yii-&gt;app-&gt;getRquest == 'action B')</code></p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>I tried it this way,</p>
  
  <pre><code>echo Yii::app()-&gt;controller-&gt;action-&gt;id . " - " . Yii::app()-&gt;controller-&gt;id . " - " . Yii::app()-&gt;controller-&gt;module-&gt;id;
  </code></pre>
  
  <p>it returns, <code>//sessionIndex - default - activities</code>  from both actions.</p>
  
  <p>but what i wanted to do is, from where did user come to this path ? his last URL.</p>
  
  <p>so i can easily track weather its action 1 or action 2 </p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>tried this way too, echo <code>Yii::app()-&gt;user-&gt;returnUrl;</code> </p>
  
  <p>but it prints onlty - /ijob-css/index.php</p>
  
  <p><strong>EDIT 3</strong></p>
  
  <p>This does that but need to know is there any better way to get it ? $_SERVER['HTTP_REFERER']; also this retuns the entire url like this <a href="http://mylocalurl.com/ijob-css/index.php/search/default/index/area/act?query=" rel="nofollow">http://mylocalurl.com/ijob-css/index.php/search/default/index/area/act?query=</a></p>
  
  <p>but i only needed "search/default/index/area/act?query=" in fact the model id is even fine alone which is "search"</p>