title: Defining the url in yii ajax get
body: <p>Am trying to perform an ajax get to a yii2 controller but the link fails to pass correctly</p>
  
  <p>This is what i have tried:</p>
  
  <pre><code>$.ajax({
     url: '&lt;?php echo Yii::$app-&gt;request-&gt;baseUrl. "/checks/items" ?&gt;',  //this fails
     type: 'get',
     data: {
               category:category,
               _csrf : '&lt;?=Yii::$app-&gt;request-&gt;getCsrfToken()?&gt;'
           },
     success: function (data) {
                  var parsedResult = $.parseJSON(data);
        .....
     $("#labels_trackcenter").html(html);
     }
    });
  </code></pre>
  
  <p>How do i pass that url</p>
  
  <p>These are the config url rules:</p>
  
  <pre><code>'urlManager' =&gt; [
          'class' =&gt; 'yii\web\UrlManager',
          'enablePrettyUrl' =&gt; true,
          'showScriptName' =&gt; false,
      ],
  </code></pre>