mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 21:45:57 +00:00
add quicktemplate example. Iris + Quicktemplate made easy 👍
Former-commit-id: b17fb21d8c1d5a73f9f9170f49ae0527870377a1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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 %}
|
||||
Reference in New Issue
Block a user