| 
									
										
										
										
											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.config.load"> | 
					
						
							|  |  |  |  <refnamediv> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |   <refname>config_load()</refname> | 
					
						
							|  |  |  |   <refpurpose> loads config file  data and assigns it to the 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>config_load</methodname> | 
					
						
							|  |  |  |    <methodparam><type>string</type><parameter>file</parameter></methodparam> | 
					
						
							|  |  |  |    <methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam> | 
					
						
							|  |  |  |   </methodsynopsis> | 
					
						
							|  |  |  |   <para> | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |    This loads | 
					
						
							|  |  |  |    <link linkend="config.files">config file</link> | 
					
						
							|  |  |  |    data and assigns it to | 
					
						
							| 
									
										
										
										
											2006-09-26 23:29:02 +00:00
										 |  |  |    the template. This works identically to the template | 
					
						
							|  |  |  |    <link linkend="language.function.config.load"> | 
					
						
							|  |  |  |    <varname>{config_load}</varname></link> function. | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |   </para> | 
					
						
							|  |  |  |   <note> | 
					
						
							|  |  |  |    <title>Technical Note</title> | 
					
						
							|  |  |  |    <para> | 
					
						
							|  |  |  |     As of Smarty 2.4.0, assigned template variables are kept across | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |     invocations of | 
					
						
							| 
									
										
										
										
											2006-09-26 23:29:02 +00:00
										 |  |  |     <link linkend="api.fetch"><varname>fetch()</varname></link> | 
					
						
							|  |  |  |     and <link linkend="api.display"><varname>display()</varname></link>. | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |     Config vars loaded from | 
					
						
							| 
									
										
										
										
											2006-09-26 23:29:02 +00:00
										 |  |  |     <varname>config_load()</varname> are always global in scope. | 
					
						
							|  |  |  |     Config files are also  compiled for faster execution, and respect the | 
					
						
							|  |  |  |     <link linkend="variable.force.compile"> | 
					
						
							|  |  |  |     <parameter>$force_compile</parameter></link> and | 
					
						
							|  |  |  |     <link linkend="variable.compile.check"> | 
					
						
							|  |  |  |     <parameter>$compile_check</parameter></link> settings. | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    </para> | 
					
						
							|  |  |  |   </note> | 
					
						
							|  |  |  |   <example> | 
					
						
							| 
									
										
										
										
											2005-05-27 16:25:02 +00:00
										 |  |  |    <title>config_load()</title> | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  |    <programlisting role="php"> | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  | <![CDATA[ | 
					
						
							|  |  |  | <?php | 
					
						
							|  |  |  | // load config variables and assign them | 
					
						
							|  |  |  | $smarty->config_load('my.conf'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // load a section | 
					
						
							| 
									
										
										
										
											2004-04-18 19:22:55 +00:00
										 |  |  | $smarty->config_load('my.conf', 'foobar'); | 
					
						
							| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2006-09-26 23:29:02 +00:00
										 |  |  |   <link linkend="language.function.config.load"><varname>{config_load}</varname></link>, | 
					
						
							|  |  |  |   <link linkend="api.get.config.vars"><varname>get_config_vars()</varname></link>, | 
					
						
							|  |  |  |   <link linkend="api.clear.config"><varname>clear_config()</varname></link>, | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |   and | 
					
						
							| 
									
										
										
										
											2006-09-26 23:29:02 +00:00
										 |  |  |   <link linkend="language.config.variables"><varname>config variables</varname></link> | 
					
						
							| 
									
										
										
										
											2005-05-23 15:43:01 +00:00
										 |  |  |   </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
										 |  |  | --> |