title: yii2 hide model name from url in GET Method
body: <p>I have a script that switches images in a certain amount of time. But on my page, the images are not displayed because they get method gets the wrong URL: <em><strong>GET http://schedule/monitor/img/math/22.03/22.03.JPG 404 (Not Found)</strong></em>. The correct URL should be like this:
  <em><strong>http://schedule/img/math/22.03/22.03.JPG</strong></em>. How to hide the model name from image src when I get this from js script?</p>
  <p><strong>slider.js</strong></p>
  <pre><code>    $(document).ready(function () {
      $.ajax({
          type: 'GET',
          dataType: 'json',
          url: '/monitor/insert_math',
          data: 'json',
          success: function (data) {
  
              var i = 0;          //START POINT
              var unfiltered_images = data;   //UNFILTERED IMAGES ARRAY
              var time = 30000;   //TIME BETWEEN SWITCH
  
              var images = unfiltered_images.filter(file =&gt; file.endsWith('.JPG')); //FILE FILTER BY EXTENSION
              console.log(images);
  
              if (images.length != 0) {
  
                  function changeImg() {
  
                      document.getElementById('slide').src = images[i];
  
                      if (i &lt; images.length - 1) { //CHECK IF INDEX IS UNDER MAX
                          i++; //ADD 1 TO INDEX
                      } else {
                          i = 0; //RESET BACK TO 0
                      }
                      setTimeout(changeImg, time); //RUN FUNCTION EVERY X SECONDS
                  }
  
                  window.onload = changeImg(); //RUN FUNCTION WHEN PAGE LOADS
              }
          }
      });
  });
  </code></pre>
  <p><strong>1311.php</strong></p>
  <pre><code>&lt;div class=&quot;info_block&quot;&gt;
        &lt;img id=&quot;slide&quot; height=&quot;626px&quot;&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>Path to PHP file:</strong></p>
  <p><a href="https://i.stack.imgur.com/pJe5v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pJe5v.png" alt="enter image description here" /></a></p>