mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
better examples
This commit is contained in:
@@ -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!
|
||||||
|
@@ -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}
|
||||||
|
Reference in New Issue
Block a user