Re: Sigma template

From: Date: Fri, 09 Jul 2004 14:03:01 +0000
Subject: Re: Sigma template
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13573@lists.php.net to get a copy of this message
Hi Alexey, Thanks for responding. For the documentation part, simply cutting and pasting the toggle() function from the documentation on the latest release of Sigma along with the PHP calls (setCallBackFunction() especially) always returns the same value for func_bgcolor('#CCCCCC', '#F0F0F0') so all the columns are the same colour. If I do an echo "test" in the toggle() function, the "test" string appears only once because its return value is saved. Is this related to a problem with my configuration? And as for the dummy parameter, I understand this but since the dummy parameter has to be different for every call, I have to check in my templates when I add a new call to a callback function to make sure I don't already have the same parameter somewhere else, which is a hassle if the templates have a lot of callback function calls. I understand adding a flag to setCallBackFunction is likely not a good idea but there really ought to be a simple way to tell Sigma when a function will be returning different values even with the same parameters... Thanks, Xavier On Thu, 2004-07-08 at 17:41, Alexey Borzov wrote: > Hi, > > Xavier Spriet wrote: > >>This behaviour is by design. I do not want to change it and do not want > >>to add Smarty-like syntax for assigning the variables: dummy parameter > >>is way easier to add than the convoluted construct you propose. > > > > --------------------------- > > > > There are a few problems with this: > > > > 1) The documentation is no longer accurate (see the example with the > > toggle() function for bgcolor callback) > > > > http://pear.php.net/manual/en/package.html.html-template-sigma.intro-syntax.php > > What exactly is not accurate? The example works as shown in the docs. > > > 2) Some calls return random values from a database. The templating > > engine then only displays the first return value. > > Add a dummy parameter to these calls. > > > It sounds like there should really be a boolean option to > > setCallBackVariable called RememberFirstValue and set by default to TRUE > > if this is by design. > > Ouch. Thanks, Xavier Spriet.

« previous php.pear.general (#13573) next »