mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
Made sections work mostly.
This commit is contained in:
@@ -10,7 +10,7 @@ $smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
|
||||
$smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
|
||||
array("I", "J", "K", "L"), array("M", "N", "O", "P")));
|
||||
|
||||
$smarty->spew("./templates/index.tpl");
|
||||
$smarty->quip("./templates/index.tpl");
|
||||
|
||||
print "\ndone\n";
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{include header.tpl}
|
||||
|
||||
{* A simple variable test *}
|
||||
hello, my name is {$Name}.<br>
|
||||
{if $Name eq "Joe"}
|
||||
I am {ldelim}Joe{rdelim}.<br>
|
||||
{else}
|
||||
I am not Joe.<br>
|
||||
{/if}
|
||||
|
||||
{include footer.tpl}
|
||||
My interests are:
|
||||
{section name=outer loop=$FirstName}
|
||||
{if %outer.index% is even by 2}
|
||||
. {$outer/FirstName} {$outer/LastName}
|
||||
{else}
|
||||
* {$outer/FirstName} {$outer/LastName}
|
||||
{/if}
|
||||
{sectionelse}
|
||||
none
|
||||
{/section}
|
||||
|
||||
Reference in New Issue
Block a user