Browse Source

Add example for template inheritance whitespace.

Justin Hileman 10 years ago
parent
commit
b3d80b9b61

+ 6 - 0
test/fixtures/examples/template_inheritance/TemplateInheritance.php

@@ -0,0 +1,6 @@
+<?php
+
+class TemplateInheritance
+{
+	// This space intentionally left blank.
+}

+ 4 - 0
test/fixtures/examples/template_inheritance/partials/my_heading.mustache

@@ -0,0 +1,4 @@
+{{% BLOCKS }}
+{{< parent_heading }}
+    {{$ head }}This is a heading{{/ head }}
+{{/ parent_heading }}

+ 10 - 0
test/fixtures/examples/template_inheritance/partials/parent.mustache

@@ -0,0 +1,10 @@
+{{% BLOCKS }}
+<!DOCTYPE html>
+<html>
+<head>
+    <title>{{$ title }}This is a title{{/ title }}</title>
+</head>
+<body>
+    {{$ content }}Placeholder content{{/ content }}
+</body>
+</html>

+ 4 - 0
test/fixtures/examples/template_inheritance/partials/parent_heading.mustache

@@ -0,0 +1,4 @@
+{{% BLOCKS }}
+<h1>
+    {{$ head }}This is a parent heading{{/ head }}
+</h1>

+ 10 - 0
test/fixtures/examples/template_inheritance/template_inheritance.mustache

@@ -0,0 +1,10 @@
+{{% BLOCKS }}
+{{< parent }}
+
+{{$ content }}
+    {{> my_heading }}
+
+    <p>Body!</p>
+{{/ content }}
+
+{{/ parent }}

+ 13 - 0
test/fixtures/examples/template_inheritance/template_inheritance.txt

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>This is a title</title>
+</head>
+<body>
+    <h1>
+        This is a heading
+    </h1>
+
+    <p>Body!</p>
+</body>
+</html>