more examples

This commit is contained in:
pete_morgan
2006-03-13 03:40:01 +00:00
parent aff1b359f1
commit d56b61f796

View File

@@ -147,21 +147,21 @@
<title>{if} statements</title> <title>{if} statements</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{if $name eq "Fred"} {if $name eq 'Fred'}
Welcome Sir. Welcome Sir.
{elseif $name eq "Wilma"} {elseif $name eq 'Wilma'}
Welcome Ma'am. Welcome Ma'am.
{else} {else}
Welcome, whatever you are. Welcome, whatever you are.
{/if} {/if}
{* an example with "or" logic *} {* an example with "or" logic *}
{if $name eq "Fred" or $name eq "Wilma"} {if $name eq 'Fred' or $name eq 'Wilma'}
... ...
{/if} {/if}
{* same as above *} {* same as above *}
{if $name == "Fred" || $name == "Wilma"} {if $name == 'Fred' || $name == 'Wilma'}
... ...
{/if} {/if}
@@ -221,6 +221,25 @@
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<example>
<title>{if} with more examples</title>
<programlisting>
<![CDATA[
{if isset($name) && $name = 'Blog'}
{* do something *}
{elseif $name == $foo}
{* do something *}
{/if}
{if is_array($foo) && count($foo) > 0)
{* do a foreach loop *}
{/if}
]]>
</programlisting>
</example>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables: