better examples

This commit is contained in:
didou
2004-05-29 21:22:39 +00:00
parent 53609f1db2
commit a68d952494
2 changed files with 20 additions and 11 deletions

View File

@@ -53,7 +53,13 @@ function do_translation ($params, $content, &$smarty, &$repeat)
} }
} }
?> ?>
]]>
</programlisting>
<para>
where the template is:
</para>
<programlisting>
<![CDATA[
{* template *} {* template *}
{translate lang="br"} {translate lang="br"}
Hello, world! Hello, world!

View File

@@ -31,8 +31,6 @@
<title>Preventing a plugin's output from being cached</title> <title>Preventing a plugin's output from being cached</title>
<programlisting role="php"> <programlisting role="php">
<![CDATA[ <![CDATA[
index.php:
<?php <?php
require('Smarty.class.php'); require('Smarty.class.php');
$smarty = new Smarty; $smarty = new Smarty;
@@ -55,10 +53,12 @@ if (!$smarty->is_cached('index.tpl')) {
$smarty->display('index.tpl'); $smarty->display('index.tpl');
?> ?>
</programlisting>
<para>
index.tpl: where index.tpl is:
</para>
<programlisting>
<![CDATA[
Time Remaining: {remain endtime=$obj->endtime} Time Remaining: {remain endtime=$obj->endtime}
]]> ]]>
</programlisting> </programlisting>
@@ -89,10 +89,13 @@ $smarty->register_block('dynamic', 'smarty_block_dynamic', false);
$smarty->display('index.tpl'); $smarty->display('index.tpl');
?> ?>
]]>
</programlisting>
index.tpl: <para>
where index.tpl is:
</para>
<programlisting>
<![CDATA[
Page created: {"0"|date_format:"%D %H:%M:%S"} Page created: {"0"|date_format:"%D %H:%M:%S"}
{dynamic} {dynamic}