On 10.06.2009, at 23:57, hosema...@poczta.onet.pl wrote:
Hi how to get $tpl->vars to include them for ex. into array and than
execue inside template?
Ex.
I have defined:
$tpl = new PHPTAL('tpl/header.tpl');
$tpl->title = 'Panel administracyjny';
$tpl->manage = 'manage';
$tpl->settings = 'settings';
echo "echo translation".$tpl->manage;
$options = array(
array($tpl->manage,'parking.png','parking.php'),
array($tpl->settings,'settings.png','settings.php'),
array('sdfsdfs','camera.png','camera.php'));
echo $tpl->execute();
and when $tpl->manage is echoed there is null. I want some value
('manage');
the goal is to input variables into array and that pass array into
template
I think reading of variables from template engine unnecessarily ties
the application to the template engine. You should use your own data
structures and only set them in PHPTAL object when displaying template:
$data = array();
$data['manage'] = 'manage';
$options = array($data['manage'],…)
…
foreach($data as $key => $value) $phptal->$key = $value;
--
regards, Kornel
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal