mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
* some wz
* no tab * add Cdata section
This commit is contained in:
@@ -59,11 +59,14 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>function include</title>
|
<title>function include</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{include file="header.tpl"}
|
{include file="header.tpl"}
|
||||||
|
|
||||||
{* body of template goes here *}
|
{* body of template goes here *}
|
||||||
|
|
||||||
{include file="footer.tpl"}</programlisting>
|
{include file="footer.tpl"}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>
|
<para>
|
||||||
You can also pass variables to included templates as attributes.
|
You can also pass variables to included templates as attributes.
|
||||||
@@ -75,11 +78,14 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>function include passing variables</title>
|
<title>function include passing variables</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{include file="header.tpl" title="Main Menu" table_bgcolor="#c0c0c0"}
|
{include file="header.tpl" title="Main Menu" table_bgcolor="#c0c0c0"}
|
||||||
|
|
||||||
{* body of template goes here *}
|
{* body of template goes here *}
|
||||||
|
|
||||||
{include file="footer.tpl" logo="http://my.example.com/logo.gif"}</programlisting>
|
{include file="footer.tpl" logo="http://my.example.com/logo.gif"}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>
|
<para>
|
||||||
Use the syntax for <link
|
Use the syntax for <link
|
||||||
@@ -89,6 +95,7 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>function include template resource examples</title>
|
<title>function include template resource examples</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* absolute filepath *}
|
{* absolute filepath *}
|
||||||
{include file="/usr/local/include/templates/header.tpl"}
|
{include file="/usr/local/include/templates/header.tpl"}
|
||||||
|
|
||||||
@@ -99,9 +106,17 @@
|
|||||||
{include file="file:C:/www/pub/templates/header.tpl"}
|
{include file="file:C:/www/pub/templates/header.tpl"}
|
||||||
|
|
||||||
{* include from template resource named "db" *}
|
{* include from template resource named "db" *}
|
||||||
{include file="db:header.tpl"}</programlisting>
|
{include file="db:header.tpl"}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>See also <link linkend="language.function.include.php">{include_php}</link>, <link linkend="language.function.php">{php}</link> <link linkend="template.resources">Template Resources</link> and <link linkend="tips.componentized.templates">Componentized Templates</link></para>
|
<para>
|
||||||
|
See also
|
||||||
|
<link linkend="language.function.include.php">{include_php}</link>,
|
||||||
|
<link linkend="language.function.php">{php}</link>,
|
||||||
|
<link linkend="template.resources">Template Resources</link> and
|
||||||
|
<link linkend="tips.componentized.templates">Componentized Templates</link>.
|
||||||
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
@@ -35,7 +35,10 @@
|
|||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>See also <link linkend="language.escaping">Escaping Smarty Parsing</link> </para>
|
<para>
|
||||||
|
See also
|
||||||
|
<link linkend="language.escaping">Escaping Smarty Parsing</link>.
|
||||||
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -11,13 +11,21 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>php tags</title>
|
<title>php tags</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{php}
|
{php}
|
||||||
// including a php script directly
|
// including a php script directly
|
||||||
// from the template.
|
// from the template.
|
||||||
include("/path/to/display_weather.php");
|
include("/path/to/display_weather.php");
|
||||||
{/php}</programlisting>
|
{/php}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>See also <link linkend="language.function.include.php">{include_php}</link>, <link linkend="language.function.include">{include}</link> and <link linkend="tips.componentized.templates">Componentized Templates</link></para>
|
<para>
|
||||||
|
See also
|
||||||
|
<link linkend="language.function.include.php">{include_php}</link>,
|
||||||
|
<link linkend="language.function.include">{include}</link> and
|
||||||
|
<link linkend="tips.componentized.templates">Componentized Templates</link>.
|
||||||
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
@@ -40,13 +40,16 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
{/strip}
|
{/strip}
|
||||||
|
|
||||||
|
|
||||||
OUTPUT:
|
|
||||||
|
|
||||||
<table border=0><tr><td><A HREF="http://my.example.com"><font color="red">This is a test</font></A></td></tr></table>
|
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
<table border=0><tr><td><A HREF="http://my.example.com"><font color="red">This is a test</font></A></td></tr></table>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
<para>
|
<para>
|
||||||
Notice that in the above example, all the lines begin and end
|
Notice that in the above example, all the lines begin and end
|
||||||
|
Reference in New Issue
Block a user