From b0422ad43cfece34a13a59129ad684d06fc95156 Mon Sep 17 00:00:00 2001 From: bzick Date: Thu, 6 Nov 2014 22:31:59 +0300 Subject: [PATCH] Add example --- sandbox/fenom.php | 19 +++-------- sandbox/templates/concat-bug.tpl | 2 -- sandbox/templates/extends/75-child.tpl | 13 ------- sandbox/templates/extends/75-parent.tpl | 12 ------- sandbox/templates/extends/parent.tpl | 0 sandbox/templates/greeting.tpl | 45 +++++++++++++++++++++---- sandbox/templates/macros.tpl | 17 +++++++--- 7 files changed, 56 insertions(+), 52 deletions(-) delete mode 100644 sandbox/templates/concat-bug.tpl delete mode 100644 sandbox/templates/extends/75-child.tpl delete mode 100644 sandbox/templates/extends/75-parent.tpl delete mode 100644 sandbox/templates/extends/parent.tpl diff --git a/sandbox/fenom.php b/sandbox/fenom.php index e76845b..4aff4aa 100644 --- a/sandbox/fenom.php +++ b/sandbox/fenom.php @@ -1,19 +1,8 @@ compile("concat-bug.tpl", false)->getBody()); -} \ No newline at end of file +$fenom->display('greeting.tpl'); \ No newline at end of file diff --git a/sandbox/templates/concat-bug.tpl b/sandbox/templates/concat-bug.tpl deleted file mode 100644 index 4f9fa48..0000000 --- a/sandbox/templates/concat-bug.tpl +++ /dev/null @@ -1,2 +0,0 @@ -Some eval: -{$dop_content = ": some texta"} \ No newline at end of file diff --git a/sandbox/templates/extends/75-child.tpl b/sandbox/templates/extends/75-child.tpl deleted file mode 100644 index e99ff4b..0000000 --- a/sandbox/templates/extends/75-child.tpl +++ /dev/null @@ -1,13 +0,0 @@ -{extends 'extends/75-parent.tpl'} -{block 'child'} - {macro child_test(v, i)} - child test - {$v}, i = {$i};
- {var $i = $i -1} - {if $i > 0} - {macro.child_test v=$v i=$i} - {/if} - {/macro} - - child call:
- {macro.child_test v = 'ok' i = 5} -{/block} \ No newline at end of file diff --git a/sandbox/templates/extends/75-parent.tpl b/sandbox/templates/extends/75-parent.tpl deleted file mode 100644 index 3f360b0..0000000 --- a/sandbox/templates/extends/75-parent.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{macro parent_test(v, i)} - parent test - {$v}, i = {$i};
-{var $i = $i -1} -{if $i > 0} - {macro.parent_test v=$v i=$i} -{/if} -{/macro} - -{block 'child'}{/block} - -parent call:
-{macro.parent_test v = 'ok' i = 5}
\ No newline at end of file diff --git a/sandbox/templates/extends/parent.tpl b/sandbox/templates/extends/parent.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/sandbox/templates/greeting.tpl b/sandbox/templates/greeting.tpl index 925f85a..b9c2e84 100644 --- a/sandbox/templates/greeting.tpl +++ b/sandbox/templates/greeting.tpl @@ -1,7 +1,40 @@ -{var:escape $a} -asdasd -{/var} +{include "header.tpl" title=""} -{*{Ts\Math::multi x=34 y=44}*} -{*{$a + Ts\Math::multi(34, 44)}*} -{*{34|Ts\Math::multi:44}*} \ No newline at end of file + {import 'macros.tpl' as menu} + + {menu.pills active='sandbox' items=$items} + +
+

Jumbotron heading

+

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

+

Sign up today

+
+ +
+ {set $text} +
+

Subheading

+

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

+ +

Subheading

+

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

+ +

Subheading

+

Maecenas sed diam eget risus varius blandit sit amet non magna.

+
+ {/set} + + {$text} + +
+

Subheading

+

Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.

+ +

Subheading

+

Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.

+ +

Subheading

+

Maecenas sed diam eget risus varius blandit sit amet non magna.

+
+
+{include "footer.tpl"} \ No newline at end of file diff --git a/sandbox/templates/macros.tpl b/sandbox/templates/macros.tpl index b7b91ba..95911e7 100644 --- a/sandbox/templates/macros.tpl +++ b/sandbox/templates/macros.tpl @@ -1,5 +1,14 @@ -{macro factorial(num)} -{if $num} - {$num} {macro.factorial num=$num-1} {$num} -{/if} +{macro pills($title, $items, $active)} +
+ +

{$title}

+
{/macro} \ No newline at end of file