*** empty log message ***

This commit is contained in:
andrey
2000-11-19 18:57:06 +00:00
parent 67bef7a475
commit 9b7b565df0
4 changed files with 10 additions and 110 deletions

View File

@@ -7,9 +7,11 @@ $smarty = new Smarty;
$smarty->assign("Name","Fred"); $smarty->assign("Name","Fred");
$smarty->assign("FirstName",array("John","Mary","James","Henry")); $smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); $smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array("A","B","C","D")); $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->spew("./templates/index.tpl");
print "\ndone\n";
?> ?>

View File

@@ -1,63 +1,11 @@
{include header.tpl} {include header.tpl}
{* A simple variable test *} {* A simple variable test *}
hello, my name is {$Name}.<br> hello, my name is {$Name}.<br>
{if $Name eq "Joe"} {if $Name eq "Joe"}
I am Joe.<br> I am {ldelim}Joe{rdelim}.<br>
{else} {else}
I am not Joe.<br> I am not Joe.<br>
{/if} {/if}
<p>
Lets loop through some information:<br>
{section name="outside" $FirstName}
current name is {$outside.LastName}, {$outside.FirstName}<br>
{section name=inside $Class}
current class is: {$inside.Class}<br>
{/section}
{if $outside.rownum.even}
row is even<br>
{else}
row is odd<br>
{/if}
{if $outside.rownum.mod.2}
row is evenly divisible by 2<br>
{else}
row is not evenly divisible by 2<br>
{/if}
{if $outside.rownum.even.2}
row is even, grouped by 2<br>
{else}
row is odd, grouped by 2<br>
{/if}
<p>
{/section}
{section name=blah $loopvar2}
test default: {htmlesc $blah.loopvar2}<br>
a free standing section.<br>
{/section}
By default, php code is escaped:<br>
<?php print "hello"; ?>
<p>
{* the config function at work *}
<p>
{configload "config/index.conf"}
config var title: {configprint "title"}<br>
config var Name: {configprint "Name"}<br>
{configset "Name", $test}
test is {htmlesc $test}<br>
{configclear}
<p>
The following text is {htmlesc "<HTML><ESCAPED>"}.<br>
{* This is a template comment *}
<p>
{strip}
All data within the<br>
{ldelim}strip{rdelim} tags is stripped<br>
of unneeded tabs, spaces and carriage returns<br>
at the beginning and end of lines<br>
in the html source (view this source)<br>
{/strip}
{include footer.tpl} {include footer.tpl}

View File

@@ -7,9 +7,11 @@ $smarty = new Smarty;
$smarty->assign("Name","Fred"); $smarty->assign("Name","Fred");
$smarty->assign("FirstName",array("John","Mary","James","Henry")); $smarty->assign("FirstName",array("John","Mary","James","Henry"));
$smarty->assign("LastName",array("Doe","Smith","Johnson","Case")); $smarty->assign("LastName",array("Doe","Smith","Johnson","Case"));
$smarty->assign("Class",array("A","B","C","D")); $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->spew("./templates/index.tpl");
print "\ndone\n";
?> ?>

View File

@@ -1,63 +1,11 @@
{include header.tpl} {include header.tpl}
{* A simple variable test *} {* A simple variable test *}
hello, my name is {$Name}.<br> hello, my name is {$Name}.<br>
{if $Name eq "Joe"} {if $Name eq "Joe"}
I am Joe.<br> I am {ldelim}Joe{rdelim}.<br>
{else} {else}
I am not Joe.<br> I am not Joe.<br>
{/if} {/if}
<p>
Lets loop through some information:<br>
{section name="outside" $FirstName}
current name is {$outside.LastName}, {$outside.FirstName}<br>
{section name=inside $Class}
current class is: {$inside.Class}<br>
{/section}
{if $outside.rownum.even}
row is even<br>
{else}
row is odd<br>
{/if}
{if $outside.rownum.mod.2}
row is evenly divisible by 2<br>
{else}
row is not evenly divisible by 2<br>
{/if}
{if $outside.rownum.even.2}
row is even, grouped by 2<br>
{else}
row is odd, grouped by 2<br>
{/if}
<p>
{/section}
{section name=blah $loopvar2}
test default: {htmlesc $blah.loopvar2}<br>
a free standing section.<br>
{/section}
By default, php code is escaped:<br>
<?php print "hello"; ?>
<p>
{* the config function at work *}
<p>
{configload "config/index.conf"}
config var title: {configprint "title"}<br>
config var Name: {configprint "Name"}<br>
{configset "Name", $test}
test is {htmlesc $test}<br>
{configclear}
<p>
The following text is {htmlesc "<HTML><ESCAPED>"}.<br>
{* This is a template comment *}
<p>
{strip}
All data within the<br>
{ldelim}strip{rdelim} tags is stripped<br>
of unneeded tabs, spaces and carriage returns<br>
at the beginning and end of lines<br>
in the html source (view this source)<br>
{/strip}
{include footer.tpl} {include footer.tpl}