mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-04 06:11:37 +01:00 
			
		
		
		
	
		
			
	
	
		
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
		
		
			
		
	
	
			54 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| 
								 | 
							
								<?xml version="1.0" encoding="iso-8859-1"?>
							 | 
						||
| 
								 | 
							
								<!-- $Revision$ -->
							 | 
						||
| 
								 | 
							
								  <sect1 id="api.assign.by.ref">
							 | 
						||
| 
								 | 
							
								   <title>assign_by_ref (via Referenz zuweisen)</title>
							 | 
						||
| 
								 | 
							
								   <funcsynopsis>
							 | 
						||
| 
								 | 
							
								    <funcprototype>
							 | 
						||
| 
								 | 
							
								     <funcdef>void <function>assign_by_ref</function></funcdef>
							 | 
						||
| 
								 | 
							
								     <paramdef>string <parameter>varname</parameter></paramdef>
							 | 
						||
| 
								 | 
							
								     <paramdef>mixed <parameter>var</parameter></paramdef>
							 | 
						||
| 
								 | 
							
								    </funcprototype>
							 | 
						||
| 
								 | 
							
								   </funcsynopsis>
							 | 
						||
| 
								 | 
							
								   <para>
							 | 
						||
| 
								 | 
							
								    Weist einen Wert via Referenz zu, anstatt eine Kopie zu machen.
							 | 
						||
| 
								 | 
							
								    Konsultieren Sie das PHP-Manual zum Thema 'variable referencing' für weitere Erklärungen.
							 | 
						||
| 
								 | 
							
								   </para>
							 | 
						||
| 
								 | 
							
								   <note>
							 | 
						||
| 
								 | 
							
								    <title>Technical Note</title>
							 | 
						||
| 
								 | 
							
								    <para>
							 | 
						||
| 
								 | 
							
								     'assign_by_ref()' ist effizienter als 'assign()', da keine Kopie der Variable
							 | 
						||
| 
								 | 
							
								     erzeugt wird, sondern auf die Variable im Speicher referenziert wird. Beachten Sie
							 | 
						||
| 
								 | 
							
								     dabei, dass eine nachträgliche änderung Original-Variable auch die zugewiesene Variable
							 | 
						||
| 
								 | 
							
								     ändert. PHP5 wird die Referenzierung automatisch übernehmen, diese
							 | 
						||
| 
								 | 
							
								     Funktion dient als Workaround.
							 | 
						||
| 
								 | 
							
								    </para>
							 | 
						||
| 
								 | 
							
								   </note>
							 | 
						||
| 
								 | 
							
								   <example>
							 | 
						||
| 
								 | 
							
								    <title>assign_by_ref (via Referenz zuweisen)</title>
							 | 
						||
| 
								 | 
							
								    <programlisting>
							 | 
						||
| 
								 | 
							
								     
							 | 
						||
| 
								 | 
							
								     // Namen/Wert-Paare übergeben
							 | 
						||
| 
								 | 
							
								     $smarty->assign_by_ref("Name",$myname);
							 | 
						||
| 
								 | 
							
								     $smarty->assign_by_ref("Address",$address);</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
							 | 
						||
| 
								 | 
							
								-->
							 |