| Recommend this page to a friend! |
| Packages of Rafa Rodriguez | Div PHP Template Engine | docs/Mechanisms/Recursion.md | Download |
|
|||||||||||||||||||||
Div interprets the template until it is not anything to interpret. For that reason, the recursion is implicit and is an intrinsic characteristic of the eninge. If you have a code like '{$\{$list}}' and \$list = 'products' then the engine convert this code to '{$products}' and if you have another variable $products with your list of products, the engine replace it, in this example, with the count of products. Low performance? No! The implementation of Div is not a recursive algorithm. The recursion is only a mechanism for the designer. Don't worry. The recursion is very useful in the creation of components. Example index.php
index.tpl Origin
Step 1
Step 2
Step 3
Step 4 |