mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-08 16:21:39 +01:00
72 lines
2.0 KiB
XML
72 lines
2.0 KiB
XML
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
|
|
<!-- $Revision$ -->
|
||
|
|
<sect1 id="plugins.inserts"><title>Inserts</title>
|
||
|
|
<para>
|
||
|
|
Plugin insert dipakai untuk mengimplementasikan fungsi yang diminta oleh
|
||
|
|
tag <link linkend="language.function.insert"><varname>{insert}</varname></link>
|
||
|
|
dalam template.
|
||
|
|
</para>
|
||
|
|
<funcsynopsis>
|
||
|
|
<funcprototype>
|
||
|
|
<funcdef>string <function>smarty_insert_<replaceable>name</replaceable></function></funcdef>
|
||
|
|
<paramdef>array <parameter>$params</parameter></paramdef>
|
||
|
|
<paramdef>object <parameter>&$smarty</parameter></paramdef>
|
||
|
|
</funcprototype>
|
||
|
|
</funcsynopsis>
|
||
|
|
<para>
|
||
|
|
Parameter pertama ke fungsi adalah array asosiatif dari atribut yang
|
||
|
|
dikirimkan ke insert.
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
Fungsi insert seharusnya mengembalikan hasil yang akan di tempatkan pada
|
||
|
|
tag <varname>{insert}</varname> dalam template.
|
||
|
|
</para>
|
||
|
|
<example>
|
||
|
|
<title>plugin insert</title>
|
||
|
|
<programlisting role="php">
|
||
|
|
<![CDATA[
|
||
|
|
<?php
|
||
|
|
/*
|
||
|
|
* Smarty plugin
|
||
|
|
* -------------------------------------------------------------
|
||
|
|
* File: insert.time.php
|
||
|
|
* Tipe: time
|
||
|
|
* Nama: time
|
||
|
|
* Kegunaan: Menyisipkan tanggak/jam saat ini berdasarkan format
|
||
|
|
* -------------------------------------------------------------
|
||
|
|
*/
|
||
|
|
function smarty_insert_time($params, &$smarty)
|
||
|
|
{
|
||
|
|
if (empty($params['format'])) {
|
||
|
|
$smarty->trigger_error("insert time: missing 'format' parameter");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
return strftime($params['format']);
|
||
|
|
}
|
||
|
|
?>
|
||
|
|
]]>
|
||
|
|
</programlisting>
|
||
|
|
</example>
|
||
|
|
</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
|
||
|
|
-->
|