@nospor, no właśnie to chciałem ominąć

na przykładzie smarty:
<?php
class TPL extends Smarty
{
public function __construct()
{
$this -> Smarty();
$this -> template_dir = TPLDIR . 'html';
$this -> config_dir = TPLDIR . 'config';
$this -> compile_dir = TPLDIR . 'cache/tpl_c';
$this -> cache_dir = TPLDIR . 'cache/smarty_c';
}
public function __get($val)
{
$this -> assign_by_ref($val_name, $val); // $val_name = zmienna
} else {
$this -> assign($val_name, $val); // $val_name = zmienna
}
}
}
$app = new init();
$zmienna = 'wartość';
$app -> tpl -> $zmienna;
?>
wtedy do smarty przypisuje assign('zmienna', $zmienna);
hmm. musi być jakiś sposób... może rozszerzenie w C++ ?