mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Separated some template code from php code.
This commit is contained in:
@@ -50,11 +50,16 @@ $smarty->display("file:admin/menu.tpl"); // same as one above
|
|||||||
$smarty->display("file:/export/templates/index.tpl");
|
$smarty->display("file:/export/templates/index.tpl");
|
||||||
$smarty->display("file:/path/to/my/templates/menu.tpl");
|
$smarty->display("file:/path/to/my/templates/menu.tpl");
|
||||||
?>
|
?>
|
||||||
|
]]>
|
||||||
{* from within Smarty template *}
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
And from within Smarty template:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{include file="file:/usr/local/share/templates/navigation.tpl"}
|
{include file="file:/usr/local/share/templates/navigation.tpl"}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<sect3 id="templates.windows.filepath">
|
<sect3 id="templates.windows.filepath">
|
||||||
@@ -73,8 +78,13 @@ $smarty->display("file:/path/to/my/templates/menu.tpl");
|
|||||||
$smarty->display("file:C:/export/templates/index.tpl");
|
$smarty->display("file:C:/export/templates/index.tpl");
|
||||||
$smarty->display("file:F:/path/to/my/templates/menu.tpl");
|
$smarty->display("file:F:/path/to/my/templates/menu.tpl");
|
||||||
?>
|
?>
|
||||||
|
]]>
|
||||||
{* from within Smarty template *}
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
And from within Smarty template:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{include file="file:D:/usr/local/share/templates/navigation.tpl"}
|
{include file="file:D:/usr/local/share/templates/navigation.tpl"}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@@ -162,11 +172,16 @@ $smarty->register_resource("db", array("db_get_template",
|
|||||||
// using resource from php script
|
// using resource from php script
|
||||||
$smarty->display("db:index.tpl");
|
$smarty->display("db:index.tpl");
|
||||||
?>
|
?>
|
||||||
|
]]>
|
||||||
{* using resource from within Smarty template *}
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
And from within Smarty template:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{include file="db:/extras/navigation.tpl"}
|
{include file="db:/extras/navigation.tpl"}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
@@ -205,10 +220,10 @@ function make_template ($resource_type, $resource_name, &$template_source, &$tem
|
|||||||
$smarty->default_template_handler_func = 'make_template';
|
$smarty->default_template_handler_func = 'make_template';
|
||||||
?>
|
?>
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
|
Reference in New Issue
Block a user