mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +02:00
update documentation corrections from marcello in the forums. Thanks marcello!
This commit is contained in:
@@ -114,7 +114,9 @@ pageTitle = "Customer Info"
|
|||||||
<link linkend="config.files">Config Files</link>
|
<link linkend="config.files">Config Files</link>
|
||||||
may also contain sections. You can load variables from
|
may also contain sections. You can load variables from
|
||||||
within a section with the added attribute
|
within a section with the added attribute
|
||||||
<parameter>section</parameter>.
|
<parameter>section</parameter>. Note that global config
|
||||||
|
variables are always loaded along with section variables,
|
||||||
|
and same-named section variables overwrite the globals.
|
||||||
</para>
|
</para>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
@@ -3,10 +3,10 @@
|
|||||||
<sect1 id="language.function.foreach">
|
<sect1 id="language.function.foreach">
|
||||||
<title>{foreach},{foreachelse}</title>
|
<title>{foreach},{foreachelse}</title>
|
||||||
<para>
|
<para>
|
||||||
<varname>{foreach}</varname> is used to loop over a
|
<varname>{foreach}</varname> is used to loop over an
|
||||||
<emphasis role="bold">single associative array</emphasis>,
|
<emphasis role="bold">associative array</emphasis> as well a numerically-indexed array,
|
||||||
unlike <link linkend="language.function.section"><varname>{section}</varname></link>
|
unlike <link linkend="language.function.section"><varname>{section}</varname></link>
|
||||||
which is for looping over <emphasis role="bold">arrays of data</emphasis>.
|
which is for looping over <emphasis role="bold">numerically-indexed arrays only</emphasis>.
|
||||||
The syntax for
|
The syntax for
|
||||||
<varname>{foreach}</varname> is much easier than
|
<varname>{foreach}</varname> is much easier than
|
||||||
<link linkend="language.function.section"><varname>{section}</varname></link>,
|
<link linkend="language.function.section"><varname>{section}</varname></link>,
|
||||||
|
@@ -15,9 +15,10 @@
|
|||||||
<emphasis>is_array()</emphasis>, etc.
|
<emphasis>is_array()</emphasis>, etc.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If <link linkend="variable.security"><parameter>$security</parameter></link> is enabled
|
If <link linkend="variable.security"><parameter>$security</parameter></link> is enabled,
|
||||||
then <emphasis>IF_FUNCS</emphasis> array in the <link
|
only PHP functions from the <emphasis>IF_FUNCS</emphasis> array from <link
|
||||||
linkend="variable.security.settings"><parameter>$security_settings</parameter></link> array.
|
linkend="variable.security.settings"><parameter>$security_settings</parameter></link>
|
||||||
|
are allowed.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The following is a list of recognized qualifiers, which must be
|
The following is a list of recognized qualifiers, which must be
|
||||||
@@ -227,7 +228,7 @@
|
|||||||
<title>{if} with more examples</title>
|
<title>{if} with more examples</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{if isset($name) && $name = 'Blog'}
|
{if isset($name) && $name == 'Blog'}
|
||||||
{* do something *}
|
{* do something *}
|
||||||
{elseif $name == $foo}
|
{elseif $name == $foo}
|
||||||
{* do something *}
|
{* do something *}
|
||||||
@@ -260,4 +261,4 @@
|
|||||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
vim: et tw=78 syn=sgml
|
vim: et tw=78 syn=sgml
|
||||||
vi: ts=1 sw=1
|
vi: ts=1 sw=1
|
||||||
-->
|
-->
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
<entry>Parameter Position</entry>
|
<entry>Parameter Position</entry>
|
||||||
<entry>Type</entry>
|
<entry>Type</entry>
|
||||||
<entry>Required</entry>
|
<entry>Required</entry>
|
||||||
<entry>cat</entry>
|
<entry>Default</entry>
|
||||||
<entry>Description</entry>
|
<entry>Description</entry>
|
||||||
</row>
|
</row>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -81,4 +81,4 @@ End:
|
|||||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||||
vim: et tw=78 syn=sgml
|
vim: et tw=78 syn=sgml
|
||||||
vi: ts=1 sw=1
|
vi: ts=1 sw=1
|
||||||
-->
|
-->
|
||||||
|
@@ -85,7 +85,7 @@ $smarty->assign('articleTitle',
|
|||||||
|
|
||||||
{$articleTitle|wordwrap:30:"<br />\n"}
|
{$articleTitle|wordwrap:30:"<br />\n"}
|
||||||
|
|
||||||
{$articleTitle|wordwrap:30:"\n":true}
|
{$articleTitle|wordwrap:26:"\n":true}
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
@@ -108,9 +108,9 @@ Blind woman gets new kidney<br />
|
|||||||
from dad she hasn't seen in<br />
|
from dad she hasn't seen in<br />
|
||||||
years.
|
years.
|
||||||
|
|
||||||
Blind woman gets new kidney
|
Blind woman gets new kidn
|
||||||
from dad she hasn't seen in
|
ey from dad she hasn't se
|
||||||
years.
|
en in years.
|
||||||
]]>
|
]]>
|
||||||
</screen>
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
</example>
|
</example>
|
||||||
<note>
|
<note>
|
||||||
<title>Top Tip</title>
|
<title>Top Tip</title>
|
||||||
<para>As easy way to examine Smarty variables is with the
|
<para>An easy way to examine Smarty variables is with the
|
||||||
<link linkend="chapter.debugging.console">debugging console</link>.
|
<link linkend="chapter.debugging.console">debugging console</link>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
@@ -156,7 +156,7 @@ define('MY_CONST_VAL','CHERRIES');
|
|||||||
<para>
|
<para>
|
||||||
Returns the name of the current template being processed.
|
Returns the name of the current template being processed.
|
||||||
The following example shows the <filename>container.tpl</filename> and the
|
The following example shows the <filename>container.tpl</filename> and the
|
||||||
<filename>included banner.tpl</filename> with
|
included <filename>banner.tpl</filename> with
|
||||||
<parameter>{$smarty.template}</parameter> within both.
|
<parameter>{$smarty.template}</parameter> within both.
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
Reference in New Issue
Block a user