title: Get current controller and action id in Yii
body: <p>I want to force all users to log in before accessing pages of my site. I have followed Larry Ullman's tutorial <a href="http://www.larryullman.com/2010/07/20/forcing-login-for-all-pages-in-yii/">Forcing Login for All Pages in Yii</a>.</p>
  
  <p>According to the tutorial you can make an exception for some pages to avoid redirecting to the log in page. In order to check the current controller it has checked <code>$_GET</code> value. My problem is that I have used <code>urlManager</code> to rewrite the URL and <code>$_GET</code> gives me a null value. Is there any method I can use to get the current controller and action in the score of my class?</p>
  
  <p>I tried the following but it is not accessible in the scope of my component class:</p>
  
  <pre><code>Yii::app()-&gt;controller-&gt;getId
  </code></pre>