mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
ed45c77be5
Former-commit-id: ed635ee95de7160cde11eaabc0c1dcb0e460a620
37 lines
654 B
Plaintext
37 lines
654 B
Plaintext
This is our templates' base implementation.
|
|
|
|
{% interface
|
|
Partial {
|
|
Body()
|
|
}
|
|
%}
|
|
|
|
|
|
Template writes a template implementing the Partial interface.
|
|
{% func Template(p Partial) %}
|
|
<html>
|
|
<head>
|
|
<title>Quicktemplate integration with Iris</title>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
Header contents here...
|
|
</div>
|
|
|
|
<div style="margin:10px;">
|
|
{%= p.Body() %}
|
|
</div>
|
|
|
|
</body>
|
|
<footer>
|
|
Footer contents here...
|
|
</footer>
|
|
</html>
|
|
{% endfunc %}
|
|
|
|
|
|
Base template implementation. Other pages may inherit from it if they need
|
|
overriding only certain Partial methods.
|
|
{% code type Base struct {} %}
|
|
{% func (b *Base) Body() %}This is the base body{% endfunc %}
|