mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-04 16:20:55 +02:00
296 lines
6.5 KiB
XML
296 lines
6.5 KiB
XML
![]() |
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
|
<!-- $Revision$ -->
|
||
|
<sect1 id="language.function.textformat">
|
||
|
<title>{textformat}</title>
|
||
|
<para>
|
||
|
<varname>{textformat}</varname> adalah
|
||
|
<link linkend="plugins.block.functions">fungsi blok</link> yang dipakai
|
||
|
untuk membentuk teks. Pada dasarnya ia membersihkan spasi dan karakter
|
||
|
khusus, dan membentuk paragraf dengan menggulung di batas dn baris
|
||
|
yang menggantung.
|
||
|
</para>
|
||
|
<para>
|
||
|
Anda bisa menyetel parameter secara eksplisit, atau memakai gaya preset.
|
||
|
Saat ini <quote>email</quote> adalah satu-satunya gaya yang tersedia.
|
||
|
</para>
|
||
|
|
||
|
<informaltable frame="all">
|
||
|
<tgroup cols="5">
|
||
|
<colspec colname="param" align="center" />
|
||
|
<colspec colname="type" align="center" />
|
||
|
<colspec colname="required" align="center" />
|
||
|
<colspec colname="default" align="center" />
|
||
|
<colspec colname="desc" />
|
||
|
<thead>
|
||
|
<row>
|
||
|
<entry>Nama Atribut</entry>
|
||
|
<entry>Tipe</entry>
|
||
|
<entry>Diperlukan</entry>
|
||
|
<entry>Default</entry>
|
||
|
<entry>Deskripsi</entry>
|
||
|
</row>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<row>
|
||
|
<entry>style</entry>
|
||
|
<entry>string</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>n/a</emphasis></entry>
|
||
|
<entry>Gaya preset</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>indent</entry>
|
||
|
<entry>number</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>0</emphasis></entry>
|
||
|
<entry>Jumlah karakter untuk melekuk setiap baris</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>indent_first</entry>
|
||
|
<entry>number</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>0</emphasis></entry>
|
||
|
<entry>Jumlah karakter untuk melekukan baris pertama</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>indent_char</entry>
|
||
|
<entry>string</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>(single space)</emphasis></entry>
|
||
|
<entry>Karakter (atau string karakter) untuk melekukan</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>wrap</entry>
|
||
|
<entry>number</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>80</emphasis></entry>
|
||
|
<entry>Berapa banyak karakter untuk menggulung setiap barisnya</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>wrap_char</entry>
|
||
|
<entry>string</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>\n</emphasis></entry>
|
||
|
<entry>Karakter (or string of chars) to break each line with</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>wrap_cut</entry>
|
||
|
<entry>boolean</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>&false;</emphasis></entry>
|
||
|
<entry>Jika &true;, gulungan akan memecah baris di karakter yang tepat
|
||
|
daripada di batas kata</entry>
|
||
|
</row>
|
||
|
<row>
|
||
|
<entry>assign</entry>
|
||
|
<entry>string</entry>
|
||
|
<entry>Tidak</entry>
|
||
|
<entry><emphasis>n/a</emphasis></entry>
|
||
|
<entry>Variabel template yang akan ditempati output</entry>
|
||
|
</row>
|
||
|
</tbody>
|
||
|
</tgroup>
|
||
|
</informaltable>
|
||
|
|
||
|
<example>
|
||
|
<title>{textformat}</title>
|
||
|
<programlisting>
|
||
|
<![CDATA[
|
||
|
{textformat wrap=40}
|
||
|
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
|
||
|
{/textformat}
|
||
|
|
||
|
]]>
|
||
|
</programlisting>
|
||
|
<para>
|
||
|
Contoh di atas akan menampilkan:
|
||
|
</para>
|
||
|
<screen>
|
||
|
<![CDATA[
|
||
|
|
||
|
This is foo. This is foo. This is foo.
|
||
|
This is foo. This is foo. This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
]]>
|
||
|
</screen>
|
||
|
<programlisting>
|
||
|
<![CDATA[
|
||
|
{textformat wrap=40 indent=4}
|
||
|
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
|
||
|
{/textformat}
|
||
|
|
||
|
]]>
|
||
|
</programlisting>
|
||
|
<para>
|
||
|
Contoh di atas akan menampilkan:
|
||
|
</para>
|
||
|
<screen>
|
||
|
<![CDATA[
|
||
|
|
||
|
This is foo. This is foo. This is
|
||
|
foo. This is foo. This is foo. This
|
||
|
is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
]]>
|
||
|
</screen>
|
||
|
<programlisting>
|
||
|
<![CDATA[
|
||
|
{textformat wrap=40 indent=4 indent_first=4}
|
||
|
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
|
||
|
{/textformat}
|
||
|
]]>
|
||
|
</programlisting>
|
||
|
<para>
|
||
|
Contoh di atas akan menampilkan:
|
||
|
</para>
|
||
|
<screen>
|
||
|
<![CDATA[
|
||
|
|
||
|
This is foo. This is foo. This
|
||
|
is foo. This is foo. This is foo.
|
||
|
This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
]]>
|
||
|
</screen>
|
||
|
<programlisting>
|
||
|
<![CDATA[
|
||
|
{textformat style="email"}
|
||
|
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
This is foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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 foo.
|
||
|
|
||
|
{/textformat}
|
||
|
|
||
|
]]>
|
||
|
</programlisting>
|
||
|
<para>
|
||
|
Contoh di atas akan menampilkan:
|
||
|
</para>
|
||
|
<screen>
|
||
|
<![CDATA[
|
||
|
|
||
|
This is foo. This is foo. This is foo. This is foo. This is foo. This is
|
||
|
foo.
|
||
|
|
||
|
This is bar.
|
||
|
|
||
|
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
|
||
|
foo.
|
||
|
|
||
|
]]>
|
||
|
</screen>
|
||
|
</example>
|
||
|
<para>
|
||
|
Lihat juga
|
||
|
<link linkend="language.function.strip"><varname>{strip}</varname></link>
|
||
|
dan
|
||
|
<link linkend="language.modifier.wordwrap"><varname>wordwrap</varname></link>.
|
||
|
</para>
|
||
|
|
||
|
</sect1>
|
||
|
<!-- Keep this comment at the end of the file
|
||
|
Local variables:
|
||
|
mode: sgml
|
||
|
sgml-omittag:t
|
||
|
sgml-shorttag:t
|
||
|
sgml-minimize-attributes:nil
|
||
|
sgml-always-quote-attributes:t
|
||
|
sgml-indent-step:1
|
||
|
sgml-indent-data:t
|
||
|
indent-tabs-mode:nil
|
||
|
sgml-parent-document:nil
|
||
|
sgml-default-dtd-file:"../../../../manual.ced"
|
||
|
sgml-exposed-tags:nil
|
||
|
sgml-local-catalogs:nil
|
||
|
sgml-local-ecat-files:nil
|
||
|
End:
|
||
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
|
vim: et tw=78 syn=sgml
|
||
|
vi: ts=1 sw=1
|
||
|
-->
|