iris/_examples/http_responsewriter/quicktemplate/templates/base.qtpl
hiveminded feb1d264c0 add quicktemplate example. Iris + Quicktemplate made easy 👍
Former-commit-id: b17fb21d8c1d5a73f9f9170f49ae0527870377a1
2017-07-18 21:17:23 +03:00

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 %}