| The Arcive of vBulletin Modifications Site. | |
| 
			 
			#1  
			
			
			
			
			
		 | |||
| 
 | |||
|  implementing php function and an array into a template 
			
			how can I implement a  php function and an array into a template  some thing similar to : PHP Code: 
			 | 
| 
			 
			#2  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			You can't put php in a template, it has to go in a plugin. You can then register a variable (in your plugin code) to a template to display it.  In the case of an array, you can then use <vb:each> tags in the template like: Code: <vb:each from="myarray" value="item">
//Code to display an item
{vb:raw item}
</vb:each>For instructions on registering variables to a template, you can look at this article: https://vborg.vbsupport.ru/showthread.php?t=228078 . If you are trying to use your array in an existing template, you will want to use the vB_Template:  reRegister() function. | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |