Re: [SMARTY] function call within function call

From: Date: Mon, 12 Feb 2007 10:03:06 +0000
Subject: Re: [SMARTY] function call within function call
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13680@lists.php.net to get a copy of this message
{checkfield data=$supplier value=$supplier_value default=$actype|get_supplier} did the trick. Great! An additional question related to the modifier: In the php-script I have a MDB2-database connection $mdb2. In modifier function I want to retrieve data from that particular database. Is there a way of relating to that global variable $mdb2 or would I have to assign it to smarty or even open a new database connection? in modifier.get_supplier.php: function smarty_modifier_get_supplier($params) { $req = 'SELECT DISTINCT Delivery FROM Lieferant WHERE AC = '. $params . ' ORDER BY Delivery ASC'; $supplier = & $mdb2->queryCol($req); if(PEAR::isError($supplier)) { die ($supplier->getMessage()); } else { return $supplier; } } Peggy

« previous php.smarty.general (#13680) next »