Re: [SMARTY] php function call

From: Date: Tue, 26 Jul 2005 23:35:40 +0000
Subject: Re: [SMARTY] php function call
References: 1 2 3  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12873@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 messju mohr wrote: > On Tue, Jul 26, 2005 at 01:39:14PM -0700, JM wrote: > >>Ok I have a group of Smarty variable assignments that I want to put in >>a php function so I can call it at various points in the script. >>However, it's not returning any data when I call the function. Any >>ideas? >> >><?php >>function meat($obj) > > > if this is php4 you have to pass $obj by reference: > function meat(&$obj) In addition to that, your variables are out of scope in the function, so they will be empty. - -- Matt Warden Miami University Oxford, OH, USA http://mattwarden.com This email proudly and graciously contributes to entropy. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD4DBQFC5sjMAQ0d4HGyPE8RAjbtAJMGFxI8Obn/siQSy3z0CiUCp6c4AJ91N3Sb rNTqgiPomwrjiU99GwxqBQ== =yG+9 -----END PGP SIGNATURE-----

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