1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00

add layouts to the _examples/view/embedding-templates-into-app

Former-commit-id: 15085969eb5cad90022b249782e0620d4f5d267a
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-10-12 23:22:18 +03:00
parent 6d94a51d3d
commit a9ac0aee2f
9 changed files with 229 additions and 42 deletions

View File

@@ -1,11 +0,0 @@
<html>
<head>
<title>{{.Title}}</title>
</head>
<body>
<h1>Hi {{.Name}}
</body>
</html>

View File

@@ -0,0 +1,12 @@
<html>
<head>
<title>Layout</title>
</head>
<body>
<h1>This is the global layout</h1>
<br />
<!-- Render the current template here -->
{{ yield }}
</body>
</html>

View File

@@ -0,0 +1,12 @@
<html>
<head>
<title>my Layout</title>
</head>
<body>
<h1>This is the layout for the /my/ and /my/other routes only</h1>
<br />
<!-- Render the current template here -->
{{ yield }}
</body>
</html>

View File

@@ -0,0 +1,7 @@
<div style="background-color: black; color: blue">
<h1>Page 1 {{ greet "iris developer"}}</h1>
{{ render "partials/page1_partial1.html"}}
</div>

View File

@@ -0,0 +1,3 @@
<div style="background-color: white; color: red">
<h1>Page 1's Partial 1</h1>
</div>