Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

You can use asset() function to access your css and javascript files in twig blocks as shown below.


You need to place css in web/assets/css/ and js in web/assets/js/ folders.

<!DOCTYPE html>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}
<link href="{{ asset('assets/css/common.css') }}" rel="stylesheet" />
{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
{% block body %}{% endblock %}
{% block javascripts %}
<script src="{{ asset('assets/js/common.js') }}"></script>
{% endblock %}