Re: Pear package: html_template_flexy: How set {tag} value withouthaving to define same variable names in controll class
| From: | Riku Tuominen | Date: | Fri, 23 Feb 2007 11:06:34 +0000 |
| Subject: | Re: Pear package: html_template_flexy: How set {tag} value withouthaving to define same variable names in controll class | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26661@lists.php.net to get a copy of this message | ||
Yes I had to figure out that my self.
Thanks for replying.
I use it 2 different ways one by one or by array..
Examples
// ******* Outputting using "one by one" method *********
$output->setData('a_title', $this->a_title);
$output->setData('b_title', $this->b_title);
$output->output(); //populate template {} tags
// ******* Outputting using "array" method ****
$myArray = array(a_title=>'JippiiA', b_title=>'JippiiB');
$output->setData($myArray);
$output->output(); //populate template {} tags
// ************************************************
Best Regards
Riku Tuominen
----- Original Message ----- From: "Alan Knowles" <alan@akbkhome.com>
To: <pear-general@lists.php.net>; "Riku Tuominen" <riku.tuominen@benchmarking.fi>
Sent: Friday, February 23, 2007 12:08 PM
Subject: Re: Pear package: html_template_flexy: How set {tag} value withouthaving to define same variable names in controll class
Riku Tuominen wrote:Pear package: html_template_flexy Any one a have a idea how manually to set values to template variables? I mean for example if we dont know at programming time what variables the template is going to include. Then we cant created apropriate variable names in our class. I would need to do something similar to. $myValue = $myData->productName; $output->setTemplateVariableValue('{Title}', $myValue);I think $flexy->setData("Title", $myValue); is probably what you are looking for. Regards AlanBest Regards Riku Tuominen-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.441 / Virus Database: 268.18.3/698 - Release Date: 23.2.2007 4:39