mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-04 16:20:55 +02:00
82 lines
2.5 KiB
XML
82 lines
2.5 KiB
XML
![]() |
<?xml version="1.0" encoding="iso-8859-1"?>
|
||
|
<!-- $Revision$ -->
|
||
|
<refentry id="api.clear.cache">
|
||
|
<refnamediv>
|
||
|
<refname>clear_cache()</refname>
|
||
|
<refpurpose>membersihkan cache untuk template tertentu</refpurpose>
|
||
|
</refnamediv>
|
||
|
<refsect1>
|
||
|
<title>Deskripsi</title>
|
||
|
<methodsynopsis>
|
||
|
<type>void</type><methodname>clear_cache</methodname>
|
||
|
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||
|
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||
|
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter>
|
||
|
</methodparam>
|
||
|
<methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
|
||
|
</methodsynopsis>
|
||
|
|
||
|
<itemizedlist>
|
||
|
<listitem><para>
|
||
|
Jika anda mempunyai <link linkend="caching.multiple.caches">multipel cache</link>
|
||
|
untuk sebuah template, anda bisa membersihkan cache tertentu dengan
|
||
|
menyertakan <parameter>cache_id</parameter> sebagai parameter kedua.
|
||
|
</para></listitem>
|
||
|
<listitem><para>
|
||
|
Anda juga bisa mengirimkan
|
||
|
<link linkend="variable.compile.id"><parameter>$compile_id</parameter></link>
|
||
|
sebagai parameter ketiga.
|
||
|
Anda dapat <link linkend="caching.groups">mengelompokan template bersama</link>
|
||
|
agar bisas dihapus sebagai sebuah grup, lihat
|
||
|
<link linkend="caching">seksi cache</link> untuk informasi lebih jauh.
|
||
|
</para></listitem>
|
||
|
<listitem><para>
|
||
|
Sebagai parameter opsional keempat, anda dapat menyertakan waktu
|
||
|
minimum dalam detik cache file seharusnya sebelum dibersihkan.
|
||
|
</para></listitem>
|
||
|
</itemizedlist>
|
||
|
|
||
|
<example>
|
||
|
<title>clear_cache()</title>
|
||
|
<programlisting role="php">
|
||
|
<![CDATA[
|
||
|
<?php
|
||
|
// bersihkan cache untuk sebuah template
|
||
|
$smarty->clear_cache('index.tpl');
|
||
|
|
||
|
// bersihkan cache untuk id cache tertentu dalam multipel-cache template
|
||
|
$smarty->clear_cache('index.tpl', 'MY_CACHE_ID');
|
||
|
?>
|
||
|
]]>
|
||
|
</programlisting>
|
||
|
</example>
|
||
|
<para>
|
||
|
Lihat juga
|
||
|
<link linkend="api.clear.all.cache"><varname>clear_all_cache()</varname></link>
|
||
|
dan seksi
|
||
|
<link linkend="caching"><varname>caching</varname></link>.
|
||
|
</para>
|
||
|
</refsect1>
|
||
|
</refentry>
|
||
|
<!-- 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
|
||
|
-->
|
||
|
|