title: How to fix this error in Slim framework?
body: <p>I installed Slim framwork using composer in wamp server.</p>
  
  <p>But displays following error.</p>
  
  <p>I am new to Slim.</p>
  
  <p>Slim Application Error
  The application could not run because of the following error:</p>
  
  <blockquote>
    <p>Details</p>
    
    <p>Type: ErrorException Code: 2 Message:
    file_get_contents(templates/index.html): failed to open stream: No
    such file or directory File:
    D:\wamp\www\photometa\vendor\twig\twig\lib\Twig\Loader\Filesystem.php
    Line: 131 Trace</p>
    
    <h1>0 [internal function]: Slim\Slim::handleErrors(2, 'file_get_conten...', 'D:\wamp\www\pho...', 131, Array)</h1>
    
    <h1>1 D:\wamp\www\photometa\vendor\twig\twig\lib\Twig\Loader\Filesystem.php(131):</h1>
    
    <p>file_get_contents('templates/index...')</p>
    
    <h1>2 D:\wamp\www\photometa\vendor\twig\twig\lib\Twig\Environment.php(397):</h1>
    
    <p>Twig_Loader_Filesystem->getSource('index.html')</p>
    
    <h1>3 D:\wamp\www\photometa\vendor\slim\views\Twig.php(87): Twig_Environment->loadTemplate('index.html')</h1>
    
    <h1>4 D:\wamp\www\photometa\vendor\slim\slim\Slim\View.php(255): Slim\Views\Twig->render('index.html', NULL)</h1>
    
    <h1>5 D:\wamp\www\photometa\vendor\slim\slim\Slim\View.php(243): Slim\View->fetch('index.html', NULL)</h1>
    
    <h1>6 D:\wamp\www\photometa\vendor\slim\slim\Slim\Slim.php(757): Slim\View->display('index.html')</h1>
    
    <h1>7 D:\wamp\www\photometa\public\index.php(33): Slim\Slim->render('index.html')</h1>
    
    <h1>8 [internal function]: {closure}()</h1>
    
    <h1>9 D:\wamp\www\photometa\vendor\slim\slim\Slim\Route.php(468): call_user_func_array(Object(Closure), Array)</h1>
    
    <h1>10 D:\wamp\www\photometa\vendor\slim\slim\Slim\Slim.php(1357): Slim\Route->dispatch()</h1>
    
    <h1>11 D:\wamp\www\photometa\vendor\slim\slim\Slim\Middleware\Flash.php(85):</h1>
    
    <p>Slim\Slim->call()</p>
    
    <h1>12 D:\wamp\www\photometa\vendor\slim\slim\Slim\Middleware\MethodOverride.php(92):</h1>
    
    <p>Slim\Middleware\Flash->call()</p>
    
    <h1>13 D:\wamp\www\photometa\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67):</h1>
    
    <p>Slim\Middleware\MethodOverride->call()</p>
    
    <h1>14 D:\wamp\www\photometa\vendor\slim\slim\Slim\Slim.php(1302): Slim\Middleware\PrettyExceptions->call()</h1>
    
    <h1>15 D:\wamp\www\photometa\public\index.php(37): Slim\Slim->run()</h1>
    
    <h1>16 {main}</h1>
  </blockquote>
  
  <p>This is index.php</p>
  
  <pre><code>&lt;?php
  require '../vendor/autoload.php';
  
  // Prepare app
  $app = new \Slim\Slim(array(
      'templates.path' =&gt; '../templates',
  ));
  
  // Create monolog logger and store logger in container as singleton 
  // (Singleton resources retrieve the same log resource definition each time)
  $app-&gt;container-&gt;singleton('log', function () {
      $log = new \Monolog\Logger('slim-skeleton');
      $log-&gt;pushHandler(new \Monolog\Handler\StreamHandler('../logs/app.log', \Monolog\Logger::DEBUG));
      return $log;
  });
  
  // Prepare view
  $app-&gt;view(new \Slim\Views\Twig());
  $app-&gt;view-&gt;parserOptions = array(
      'charset' =&gt; 'utf-8',
      'cache' =&gt; realpath('../templates/cache'),
      'auto_reload' =&gt; true,
      'strict_variables' =&gt; false,
      'autoescape' =&gt; true
  );
  $app-&gt;view-&gt;parserExtensions = array(new \Slim\Views\TwigExtension());
  
  // Define routes
  $app-&gt;get('/', function () use ($app) {
      // Sample log message
      $app-&gt;log-&gt;info("Slim-Skeleton '/' route");
      // Render index view
      $app-&gt;render('index.html');
  });
  
  // Run app
  $app-&gt;run();
  </code></pre>