After investing quite some time on this problem I still cannot get this to work. In my base.html.twig file I link to the bootstrap.min.css file, located at css/bootstrap.min.css inside the web directory, as follows:
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}" />
{% endblock %}
I then extend the base.html.twig file in my template files, when I navigate to any of these files I get the following error message:
> Request URL:http://example/css/bootstrap.min.css
Request Method:GET
Status Code:404 Not Found
I'm at a loss as to what I'm doing wrong here! Any help would be appreciated.
base.html.twig file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>{% block title %}Welcome!{% endblock %}</title>
<!-- Bootstrap core CSS -->
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('css/bootstrap.min.css') }}" />
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
{% endblock %}
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Todo List</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="/">Home</a></li>
<li><a href="/todo/create">Add todo</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
{% block body %}{% endblock %}
</div>
</div>
</div><!-- /.container -->
{% block javascripts %}
{% endblock %}
</body>
</html>
The index.html.twig file:
{% extends 'base.html.twig' %}
{% block body %}
/INDEX
{% endblock %}
My server config:
<VirtualHost *:80>
DocumentRoot "/xampp/htdocs/symfony/todolist/web/app_dev.php"
ServerName todolist
</VirtualHost>