mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
* some wz
* no tab * add Cdata section # make test before commit ;)
This commit is contained in:
@@ -43,13 +43,20 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>assign</title>
|
<title>assign</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{assign var="name" value="Bob"}
|
{assign var="name" value="Bob"}
|
||||||
|
|
||||||
The value of $name is {$name}.
|
The value of $name is {$name}.
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
The value of $name is Bob.</programlisting>
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
The value of $name is Bob.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -59,8 +59,7 @@
|
|||||||
<entry>string</entry>
|
<entry>string</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry><emphasis>n/a</emphasis></entry>
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
<entry>the template variable the output will be assigned
|
<entry>the template variable the output will be assigned to</entry>
|
||||||
to</entry>
|
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
|
@@ -85,43 +85,68 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>math</title>
|
<title>math</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* $height=4, $width=5 *}
|
{* $height=4, $width=5 *}
|
||||||
|
|
||||||
{math equation="x + y" x=$height y=$width}
|
{math equation="x + y" x=$height y=$width}
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
9
|
9
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
|
{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
|
||||||
|
|
||||||
{math equation="height * width / division"
|
{math equation="height * width / division"
|
||||||
height=$row_height
|
height=$row_height
|
||||||
width=$row_width
|
width=$row_width
|
||||||
division=#col_div#}
|
division=#col_div#}
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
100
|
100
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* you can use parenthesis *}
|
{* you can use parenthesis *}
|
||||||
|
|
||||||
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
|
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
6
|
6
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* you can supply a format parameter in sprintf format *}
|
{* you can supply a format parameter in sprintf format *}
|
||||||
|
|
||||||
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
9.44</programlisting>
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
9.44
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
@@ -93,6 +93,7 @@
|
|||||||
<example>
|
<example>
|
||||||
<title>textformat</title>
|
<title>textformat</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{textformat wrap=40}
|
{textformat wrap=40}
|
||||||
|
|
||||||
This is foo.
|
This is foo.
|
||||||
@@ -114,7 +115,13 @@ bar foo bar foo foo.
|
|||||||
|
|
||||||
{/textformat}
|
{/textformat}
|
||||||
|
|
||||||
OUTPUT:
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
|
||||||
This is foo. This is foo. This is foo.
|
This is foo. This is foo. This is foo.
|
||||||
This is foo. This is foo. This is foo.
|
This is foo. This is foo. This is foo.
|
||||||
@@ -125,8 +132,10 @@ bar foo bar foo foo. bar foo bar foo
|
|||||||
foo. bar foo bar foo foo. bar foo bar
|
foo. bar foo bar foo foo. bar foo bar
|
||||||
foo foo. bar foo bar foo foo. bar foo
|
foo foo. bar foo bar foo foo. bar foo
|
||||||
bar foo foo. bar foo bar foo foo.
|
bar foo foo. bar foo bar foo foo.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{textformat wrap=40 indent=4}
|
{textformat wrap=40 indent=4}
|
||||||
|
|
||||||
This is foo.
|
This is foo.
|
||||||
@@ -148,7 +157,13 @@ bar foo bar foo foo.
|
|||||||
|
|
||||||
{/textformat}
|
{/textformat}
|
||||||
|
|
||||||
OUTPUT:
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
|
||||||
This is foo. This is foo. This is
|
This is foo. This is foo. This is
|
||||||
foo. This is foo. This is foo. This
|
foo. This is foo. This is foo. This
|
||||||
@@ -161,7 +176,10 @@ OUTPUT:
|
|||||||
bar foo foo. bar foo bar foo foo.
|
bar foo foo. bar foo bar foo foo.
|
||||||
bar foo bar foo foo. bar foo bar
|
bar foo bar foo foo. bar foo bar
|
||||||
foo foo.
|
foo foo.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{textformat wrap=40 indent=4 indent_first=4}
|
{textformat wrap=40 indent=4 indent_first=4}
|
||||||
|
|
||||||
This is foo.
|
This is foo.
|
||||||
@@ -182,8 +200,13 @@ bar foo bar foo foo.
|
|||||||
bar foo bar foo foo.
|
bar foo bar foo foo.
|
||||||
|
|
||||||
{/textformat}
|
{/textformat}
|
||||||
|
]]>
|
||||||
OUTPUT:
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
|
||||||
This is foo. This is foo. This
|
This is foo. This is foo. This
|
||||||
is foo. This is foo. This is foo.
|
is foo. This is foo. This is foo.
|
||||||
@@ -196,7 +219,10 @@ OUTPUT:
|
|||||||
foo bar foo foo. bar foo bar foo
|
foo bar foo foo. bar foo bar foo
|
||||||
foo. bar foo bar foo foo. bar foo
|
foo. bar foo bar foo foo. bar foo
|
||||||
bar foo foo.
|
bar foo foo.
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{textformat style="email"}
|
{textformat style="email"}
|
||||||
|
|
||||||
This is foo.
|
This is foo.
|
||||||
@@ -218,7 +244,13 @@ bar foo bar foo foo.
|
|||||||
|
|
||||||
{/textformat}
|
{/textformat}
|
||||||
|
|
||||||
OUTPUT:
|
]]>
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
|
The above example will output:
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
|
||||||
This is foo. This is foo. This is foo. This is foo. This is foo. This is
|
This is foo. This is foo. This is foo. This is foo. This is foo. This is
|
||||||
foo.
|
foo.
|
||||||
@@ -229,7 +261,8 @@ bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
|
|||||||
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
|
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
|
||||||
foo.
|
foo.
|
||||||
|
|
||||||
</programlisting>
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
Reference in New Issue
Block a user