<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     setvars
 * Filename: function.setvars.php   
 * Version:  1.0
 * Date:     February 26, 2009
 * Author:   Zakaria KHANFRI - plus.google.com/111352031831257843001 - All rights reserved
 * Purpose:  assigning several template variables during the execution of a template.
 * Install:  * put function.setvars.php in plugin dir
 *           * call from within a template
 *
 * Example:		{setvars var1='value1' var2=value var3=value3}
				{$var1}{$var2}{var3}
 * -------------------------------------------------------------
 */
 
	function smarty_function_setvars($params, &$smarty) {
		if (!empty($params)) {
			foreach ($params as $key => $value) {
				$smarty->assign($key, $value);
			}
		}
	}
?>

Follow the link below to download function.setvars.php

http://goo.gl/ZA7nR

Back to SmartyPlugins?.