title: Twig is unable to find the template even though it exists
body: <p>This is my <code>config.php</code> file located in root directory of my site:</p>
  
  <pre><code>&lt;?php
  
      define('SITE_ROOT',  dirname(__FILE__));
      define('CORE_DIR',   SITE_ROOT . '/core');
      define('VIEWS_DIR',  SITE_ROOT . '/views');
      define('ASSETS_DIR', SITE_ROOT . '/assets');
  
      require SITE_ROOT . '/vendor/autoload.php';
      require CORE_DIR . '/DBConnector.php';
  
      $loader = new Twig_Loader_Filesystem(VIEWS_DIR);
      $twig = new Twig_Environment($loader);
  
      function loadHead($title) {
  
          global $twig;
  
          echo $twig-&gt;render(VIEWS_DIR . '/head.html', array('naslov' =&gt; $title));
  
      }
  </code></pre>
  
  <p><code>SITE_ROOT</code> is <code>/Applications/XAMPP/xamppfiles/htdocs/site_name</code> where <code>config.php</code> is located too and <code>head.html</code> is located in <code>views</code> folder.</p>
  
  <p><a href="https://i.stack.imgur.com/2dSMz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2dSMz.png" alt="enter image description here"></a></p>
  
  <p>However, I'm still getting error whenever I try to access any page in site root directory.</p>
  
  <pre><code>Fatal error: Uncaught Twig_Error_Loader: Unable to find template "/Applications/XAMPP/xamppfiles/htdocs/site_name/views/head.html" (looked into: /Applications/XAMPP/xamppfiles/htdocs/site_name/views).
  </code></pre>
  
  <p>So far, I tried to restart Apache server, checked directory two times to ensure that file is <strong>actually</strong> there (it is and I can access it directly via browser), checked folder permissions and cleared the cache but nothing worked.</p>