I have one base .css file under app/Resources/public/css/. Every file should include it so I wanna place it in the layout file. I also want to include additional css files if there'd be any. This is how my layout looks like:
<!DOCTYPE>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Title{% endblock %}</title>
<link rel="stylesheet" type="text/css" charset="UTF-8" media="all" href="{{ asset('css/base.css') }}">
{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
As far as I know it should include my base .css file and any other .css files I use in stylesheet block.
However it doesn't work. It generates the relative url to the css file, but it just doesn't open. Typing this url to the browser (localhost/project/web/css/base.css) gives some uncaught exception.
Fatal error: Uncaught exception 'Symfony\Component\Routing\Exception\ResourceNotFoundException' in C:\xampp\htdocs\MyFitnessManager\app\cache\prod\appProdUrlMatcher.php:33 Stack trace: #0 C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php(1207): appProdUrlMatcher->match('/css/base.css') #1 C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php(1872): Symfony\Component\Routing\Router->match('/css/base.css') #2 [internal function]: Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object(Symfony\Component\HttpKernel\Event\GetResponseEvent)) #3 C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php(1667): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseEvent)) #4 C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php(1600): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.request', Object(Symfony\Component\HttpKernel\Event\GetResponseEvent)) #5 C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php(1764): Symfony\Comp in C:\xampp\htdocs\MyFitnessManager\app\cache\prod\classes.php on line 1883
What's going on?