mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-04 06:11:37 +01:00 
			
		
		
		
	
		
			
	
	
		
			96 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
		
		
			
		
	
	
			96 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| 
								 | 
							
								<?xml version="1.0" encoding="iso-8859-1"?>
							 | 
						|||
| 
								 | 
							
								<!-- $Revision$ -->
							 | 
						|||
| 
								 | 
							
								       <sect1 id="language.config.variables">
							 | 
						|||
| 
								 | 
							
											<title>Variables charg<72>es depuis des fichiers de configuration</title>
							 | 
						|||
| 
								 | 
							
											<para>
							 | 
						|||
| 
								 | 
							
								          Les variables r<>cup<75>r<EFBFBD>es depuis un fichier de configuration sont utilis<69>es
							 | 
						|||
| 
								 | 
							
								          entour<75>es du symbole di<64>se (#), ou via la variable sp<73>ciale smarty
							 | 
						|||
| 
								 | 
							
								          <link
							 | 
						|||
| 
								 | 
							
											 linkend="language.variables.smarty.config">$smarty.config</link>.
							 | 
						|||
| 
								 | 
							
											</para>
							 | 
						|||
| 
								 | 
							
								<example>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<title>variables de fichiers de configuration</title>
							 | 
						|||
| 
								 | 
							
								<programlisting>
							 | 
						|||
| 
								 | 
							
								foo.conf:
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								pageTitle = "C'est le mien"
							 | 
						|||
| 
								 | 
							
								bodyBgColor = "#eeeeee"
							 | 
						|||
| 
								 | 
							
								tableBorderSize = "3"
							 | 
						|||
| 
								 | 
							
								tableBgColor = "#bbbbbb"
							 | 
						|||
| 
								 | 
							
								rowBgColor = "#cccccc"
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								index.tpl:
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								{config_load file="foo.conf"}
							 | 
						|||
| 
								 | 
							
								<html>
							 | 
						|||
| 
								 | 
							
								<title>{#pageTitle#}</title>
							 | 
						|||
| 
								 | 
							
								<body bgcolor="{#bodyBgColor#}">
							 | 
						|||
| 
								 | 
							
								<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="{#rowBgColor#}">
							 | 
						|||
| 
								 | 
							
									<td>First</td>
							 | 
						|||
| 
								 | 
							
									<td>Last</td>
							 | 
						|||
| 
								 | 
							
									<td>Address</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								</table>
							 | 
						|||
| 
								 | 
							
								</body>
							 | 
						|||
| 
								 | 
							
								</html>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								index.tpl: (alternate syntax)
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								{config_load file="foo.conf"}
							 | 
						|||
| 
								 | 
							
								<html>
							 | 
						|||
| 
								 | 
							
								<title>{$smarty.config.pageTitle}</title>
							 | 
						|||
| 
								 | 
							
								<body bgcolor="{$smarty.config.bodyBgColor}">
							 | 
						|||
| 
								 | 
							
								<table border="{$smarty.config.tableBorderSize}" bgcolor="{$smarty.config.tableBgColor}">
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="{$smarty.config.rowBgColor}">
							 | 
						|||
| 
								 | 
							
									<td>First</td>
							 | 
						|||
| 
								 | 
							
									<td>Last</td>
							 | 
						|||
| 
								 | 
							
									<td>Address</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								</table>
							 | 
						|||
| 
								 | 
							
								</body>
							 | 
						|||
| 
								 | 
							
								</html>
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								SORTIE: (same for both examples)
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								<html>
							 | 
						|||
| 
								 | 
							
								<title>C'est le mien</title>
							 | 
						|||
| 
								 | 
							
								<body bgcolor="#eeeeee">
							 | 
						|||
| 
								 | 
							
								<table border="3" bgcolor="#bbbbbb">
							 | 
						|||
| 
								 | 
							
								<tr bgcolor="#cccccc">
							 | 
						|||
| 
								 | 
							
									<td>First</td>
							 | 
						|||
| 
								 | 
							
									<td>Last</td>
							 | 
						|||
| 
								 | 
							
									<td>Address</td>
							 | 
						|||
| 
								 | 
							
								</tr>
							 | 
						|||
| 
								 | 
							
								</table>
							 | 
						|||
| 
								 | 
							
								</body>
							 | 
						|||
| 
								 | 
							
								</html></programlisting>
							 | 
						|||
| 
								 | 
							
								</example>
							 | 
						|||
| 
								 | 
							
											<para>
							 | 
						|||
| 
								 | 
							
								         Les variables de fichier de configuration ne peuvent <20>tre utilis<69>s tant
							 | 
						|||
| 
								 | 
							
								         qu'elles n'ont pas <20>t<EFBFBD> charg<72>es. Cette proc<6F>dure est expliqu<71>e
							 | 
						|||
| 
								 | 
							
								         plus loin dans le document, voir <command>config_load</command>.
							 | 
						|||
| 
								 | 
							
											</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
							 | 
						|||
| 
								 | 
							
								-->
							 |