PHP Classes

File: docs/Appendixes/Appendix B - Comparison of syntax of Smarty and Div.md

Recommend this page to a friend!
  Packages of Rafa Rodriguez   Div PHP Template Engine   docs/Appendixes/Appendix B - Comparison of syntax of Smarty and Div.md   Download  
File: docs/Appendixes/Appendix B - Comparison of syntax of Smarty and Div.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Div PHP Template Engine
Template processing engine that replaces tags
Author: By
Last change:
Date: 4 months ago
Size: 613 bytes
 

Contents

Class file image Download

Loops

Smarty:

{foreach $foo as $bar}
	  <a href="{$bar.zig}">{$bar.zag}</a>
	  <a href="{$bar.zig2}">{$bar.zag2}</a>
	  <a href="{$bar.zig3}">{$bar.zag3}</a>
	{foreachelse}
	  There were no rows found
{/foreach}

Div:

[$foo]
  <a href="{$zig}">{$zag}</a>
  <a href="{$zig2}">{$zag2}</a>
  <a href="{$zig3}">{$zag3}</a>
@empty@
  There were no rows found
[/$foo]

Include

Smarty:

{include file="header.tpl"}

Div:

(% header %}

Iterations

Smarty:

{for $x = 1 to 20 step 2}
	  {$x}
{/for}

Div:

[:1,20,x,2:]
	  {$x} 
[/]