Skip to content

Latest commit

 

History

History
40 lines (20 loc) · 498 Bytes

example-of-compiled-templates-using-inheritance.md

File metadata and controls

40 lines (20 loc) · 498 Bytes

Example of compiled templates using inheritance

Using the Twig library.

// template.html

<html>

<head>

<title>{% block title %}{% endblock %}</title>

</head>

<body>

<main>

{% block content %}{% endblock %}

</main>

</body>

</html>

// user_profile.html

{% extends "template.html" %}

{% block title %}User Profile{% endblock %}

{% block content %}

<h1>User Profile</h1>

<p>Hello, {{ name }}</p>

{% endblock %}