Skip to content

Commit a7b3c40

Browse files
committed
Add example views to MicroKernelTrait description
1 parent a5adc30 commit a7b3c40

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

configuration/micro_kernel_trait.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,31 @@ Template files should live in the ``Resources/views`` directory of whatever dire
276276
your *kernel* lives in. Since ``AppKernel`` lives in ``app/``, this template lives
277277
at ``app/Resources/views/micro/random.html.twig``.
278278

279+
.. code-block:: twig
280+
281+
{% extends 'base.html.twig' %}
282+
{% block body %}
283+
<p>{{ number }}</p>
284+
{% endblock %}
285+
286+
You need also create base template ``app/Resources/views/base.html.twig``.
287+
288+
.. code-block:: twig
289+
290+
<!DOCTYPE html>
291+
<html>
292+
<head>
293+
<meta charset="UTF-8" />
294+
<title>{% block title %}Welcome!{% endblock %}</title>
295+
{% block stylesheets %}{% endblock %}
296+
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
297+
</head>
298+
<body>
299+
{% block body %}{% endblock %}
300+
{% block javascripts %}{% endblock %}
301+
</body>
302+
</html>
303+
279304
Finally, you need a front controller to boot and run the application. Create a
280305
``web/index.php``::
281306

0 commit comments

Comments
 (0)