title: Get action and controller name from Url, Yii2
body: <p>Im new to Yii, and not sure is it possible to get action and controller names from url like:</p>
  
  <pre><code>/my_proj/backend/web/index.php?r=user%2Fcreate
  </code></pre>
  
  <p>I need to get them in controller(<code>php</code>) or client side (<code>jQuery</code>).</p>
  
  <p>I need it because, on button click:</p>
  
  <pre><code> &lt;?= Html::button(Yii::t('app', Yii::t('app','Create')), ['value' =&gt; Url::to(['create']),'class' =&gt; 'btn btn-success modalButton', 'id' =&gt; 'create-user']) ?&gt;
  </code></pre>
  
  <p>I want to check if the current user has permissions for <code>create</code> action. I need this on client side, because I show create view in modal dialog, and if user does not have permission, i don't need to show popup.</p>
  
  <pre><code>  $(".modalButton").click(function(){  
     var permission = ?? //$(this)[0].id; //id works ok, but looking for another way
  
      $.get('index.php?r=site/check-permission', {'permission': permission}, function(isAllowed){ 
          if(isAllowed == 1)
          {
              $(".modal").modal("show")
                         .find(".modalContent")
                         .load($(".modalButton").attr('value'));
          }
     }); 
  
    return false;   
  });
  </code></pre>
  
  <p>I tried to use <code>id</code> for button, and specify permission there, but looking for another solution. </p>