mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +02:00
removed paragraph that may encourage using {include_php} over custom
functions. the opposite should be proposed.
This commit is contained in:
@@ -70,17 +70,6 @@
|
|||||||
<link linkend="variable.trusted.dir">$trusted_dir</link>,
|
<link linkend="variable.trusted.dir">$trusted_dir</link>,
|
||||||
or an absolute path.
|
or an absolute path.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
{include_php} is a nice way to handle <link
|
|
||||||
linkend="tips.componentized.templates">componentized templates</link>, and
|
|
||||||
keep PHP code separate from the template files. Lets say you have a
|
|
||||||
template that shows your site navigation, which is pulled
|
|
||||||
dynamically from a database. You can keep your PHP logic that grabs
|
|
||||||
database content in a separate directory, and include it at the top
|
|
||||||
of the template. Now you can include this template anywhere without
|
|
||||||
worrying if the database information was assigned by the application
|
|
||||||
before hand.
|
|
||||||
</para>
|
|
||||||
<para>
|
<para>
|
||||||
By default, php files are only included once even if called
|
By default, php files are only included once even if called
|
||||||
multiple times in the template. You can specify that it should be
|
multiple times in the template. You can specify that it should be
|
||||||
@@ -128,18 +117,14 @@ $this->assign('sections',$sql->record);
|
|||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
See also
|
See also <link linkend="language.function.include">{include}</link>,
|
||||||
<link linkend="language.function.include">{include}</link>,
|
<link linkend="language.function.php">{php}</link>, <link
|
||||||
<link linkend="language.function.php">{php}</link>,
|
linkend="language.function.capture">{capture}</link>, <link
|
||||||
<link linkend="language.function.capture">{capture}</link>,
|
linkend="template.resources">Template Resources</link> and <link
|
||||||
<link linkend="template.resources">Template Resources</link> and
|
linkend="tips.componentized.templates">Componentized
|
||||||
<link linkend="tips.componentized.templates">Componentized Templates</link>
|
Templates</link> </para>
|
||||||
</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:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
|
Reference in New Issue
Block a user