| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | <?xml version="1.0" encoding="iso-8859-1"?> | 
					
						
							|  |  |  | <!-- $Revision$ --> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  | <refentry id="api.clear.cache"> | 
					
						
							|  |  |  |  <refnamediv> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |   <refname>clear_cache()</refname> | 
					
						
							|  |  |  |   <refpurpose>clears the cache for a specific template</refpurpose> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |  </refnamediv> | 
					
						
							|  |  |  |  <refsect1> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |   <title>Description</title> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |   <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> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |    <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter> | 
					
						
							|  |  |  |    </methodparam> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    <methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam> | 
					
						
							|  |  |  |   </methodsynopsis> | 
					
						
							|  |  |  |   <para> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |    If you have <link linkend="caching.multiple.caches">multiple caches</link> | 
					
						
							|  |  |  |    for a template, you can clear a specific | 
					
						
							|  |  |  |    cache by supplying the <parameter>cache_id</parameter> as the second | 
					
						
							|  |  |  |    parameter. | 
					
						
							|  |  |  |    You can also pass a | 
					
						
							|  |  |  |    <link linkend="variable.compile.id"><parameter>$compile_id</parameter></link> | 
					
						
							|  |  |  |    as a third parameter. | 
					
						
							|  |  |  |    You can <link linkend="caching.groups">"group"</link> templates | 
					
						
							|  |  |  |    together so they can be removed as a group. See the | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    <link linkend="caching">caching section</link> for more | 
					
						
							|  |  |  |    information. As an optional fourth parameter, you can supply a | 
					
						
							|  |  |  |    minimum age in seconds the cache file must be before it will | 
					
						
							|  |  |  |    get cleared. | 
					
						
							|  |  |  |   </para> | 
					
						
							|  |  |  |   <example> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |    <title>clear_cache()</title> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    <programlisting role="php"> | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | <![CDATA[ | 
					
						
							|  |  |  | <?php | 
					
						
							|  |  |  | // clear the cache for a template | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  | $smarty->clear_cache('index.tpl'); | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | // clear the cache for a particular cache id in an multiple-cache template | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  | $smarty->clear_cache('index.tpl', 'CACHEID'); | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | ?> | 
					
						
							|  |  |  | ]]> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    </programlisting> | 
					
						
							|  |  |  |   </example> | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |   <para> | 
					
						
							|  |  |  |   See also | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |   <link linkend="api.clear.all.cache">clear_all_cache()</link> | 
					
						
							|  |  |  |   and | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |   <link linkend="caching">caching</link>. | 
					
						
							|  |  |  |   </para> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |  </refsect1> | 
					
						
							|  |  |  | </refentry> | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | <!-- 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 | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  | --> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  | 
 |