added an example

This commit is contained in:
pete_morgan
2006-03-28 01:15:34 +00:00
parent 796a57cddf
commit f756e42f38

View File

@@ -3,14 +3,14 @@
<sect1 id="language.function.php"> <sect1 id="language.function.php">
<title>{php}</title> <title>{php}</title>
<para> <para>
{php} tags allow php to be embedded directly into the template. They The {php} tags allow PHP code to be embedded directly into the template. They
will not be escaped, regardless of the <link will not be escaped, regardless of the <link
linkend="variable.php.handling">$php_handling</link> setting. This linkend="variable.php.handling">$php_handling</link> setting. This
is for advanced users only, not normally needed. is for advanced users only, not normally needed and not recommended.
</para> </para>
<example> <example>
<title>{php} tags</title> <title>{php} tags</title>
<programlisting role="php"> <programlisting>
<![CDATA[ <![CDATA[
{php} {php}
// including a php script directly // including a php script directly
@@ -30,15 +30,19 @@
</note> </note>
<example> <example>
<title>{php} tags with global</title> <title>{php} tags with global and assigning a variable</title>
<programlisting role="php"> <programlisting role="php">
<![CDATA[ <![CDATA[
{php} {php}
global $foo, $bar; global $foo, $bar;
if($foo == $bar){ if($foo == $bar){
// do something echo 'This will come out in the template';
} }
$this->assign('varX','Strawberry');
{/php} {/php}
<strong>{$varX}</strong> is my fav ice cream
]]> ]]>
</programlisting> </programlisting>
</example> </example>