| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  |  | <?xml version="1.0" encoding="iso-8859-1"?> | 
					
						
							|  |  |  |  | <!-- $Revision$ --> | 
					
						
							| 
									
										
										
										
											2006-10-14 04:29:44 +00:00
										 |  |  |  | <!-- EN-Revision: 1.1 Maintainer: nobody Status: ready -->      | 
					
						
							|  |  |  |  | <sect1 id="api.append.by.ref"> | 
					
						
							| 
									
										
										
										
											2004-04-13 11:47:32 +00:00
										 |  |  |  |       <title>append_by_ref</title> | 
					
						
							|  |  |  |  |       <funcsynopsis> | 
					
						
							|  |  |  |  |        <funcprototype> | 
					
						
							|  |  |  |  |         <funcdef>void <function>append_by_ref</function></funcdef> | 
					
						
							|  |  |  |  |         <paramdef>string <parameter>varname</parameter></paramdef> | 
					
						
							|  |  |  |  |         <paramdef>mixed <parameter>var</parameter></paramdef> | 
					
						
							|  |  |  |  |        </funcprototype> | 
					
						
							|  |  |  |  |        <funcprototype> | 
					
						
							|  |  |  |  |         <funcdef>void <function>append_by_ref</function></funcdef> | 
					
						
							|  |  |  |  |         <paramdef>string <parameter>varname</parameter></paramdef> | 
					
						
							|  |  |  |  |         <paramdef>mixed <parameter>var</parameter></paramdef> | 
					
						
							|  |  |  |  |         <paramdef>boolean <parameter>merge</parameter></paramdef> | 
					
						
							|  |  |  |  |        </funcprototype> | 
					
						
							|  |  |  |  |       </funcsynopsis> | 
					
						
							|  |  |  |  |       <para> | 
					
						
							|  |  |  |  | 	   Isso <20> usado para adicionar vlaores para o template por refer<65>ncia. | 
					
						
							|  |  |  |  | 	   Se voc<6F> adicionar uma vari<72>vel por refer<65>ncia e ent<6E>o alterar este valor | 
					
						
							|  |  |  |  | 	   o valor adicionado enxergar<61> a altera<72><61>o tamb<6D>m. Para objetos, | 
					
						
							|  |  |  |  | 	   append_by_ref() tamb<6D>m evita uma c<>pia em mem<65>ria do objeto adicionado.  | 
					
						
							|  |  |  |  | 	   Veja o manual do PHP em referenciando vari<72>veis para uma melhor explana<6E><61>o sobre o assunto. | 
					
						
							|  |  |  |  | 	   Se voc<6F> passar o terceiro par<61>metro opcional para true, | 
					
						
							|  |  |  |  | 	   o valor ir<69> ser mesclado com o array atual ao inv<6E>s de adicion<6F>-lo.    | 
					
						
							|  |  |  |  |       </para> | 
					
						
							|  |  |  |  | 	  <note> | 
					
						
							|  |  |  |  | 	  <title>Notas T<>cnicas</title> | 
					
						
							|  |  |  |  | 	  <para> | 
					
						
							|  |  |  |  | 	  O par<61>metro de uni<6E>o respeita a chave do array, ent<6E>o se voc<6F> mesclar | 
					
						
							|  |  |  |  | 	  dois <20>ndices n<>mericos de arrays, eles devem sobrescrever-se um ao outro ou | 
					
						
							|  |  |  |  | 	  em resultados n<>o sequ<71>ncias de chave. Isso <20> diferente da fun<75><6E>o de PHP array_merge() | 
					
						
							|  |  |  |  | 	  que apaga as chaves num<75>ricas e as renumera. | 
					
						
							|  |  |  |  | 	  </para> | 
					
						
							|  |  |  |  | 	  </note> | 
					
						
							|  |  |  |  |       <example> | 
					
						
							|  |  |  |  |        <title>append_by_ref</title> | 
					
						
							|  |  |  |  |        <programlisting> | 
					
						
							|  |  |  |  | // appending name/value pairs | 
					
						
							|  |  |  |  | $smarty->append_by_ref("Name",$myname); | 
					
						
							|  |  |  |  | $smarty->append_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 | 
					
						
							|  |  |  |  | --> |