Esempio n. 1
0
    public function apply($group, $text_id)
    {
        $args = func_get_args();
        unset($args[0]);
        unset($args[1]);
        $this->replacements[$group][$text_id] = vsprintf($this->data[$group][$text_id], $args);
    }
    // end apply();
    public function putApply($group, $text_id)
    {
        $args = func_get_args();
        unset($args[0]);
        unset($args[1]);
        return vsprintf($this->data[$group][$text_id], $args);
    }
}
try {
    $tpl = new optClass();
    $tpl->root = './templates/';
    $tpl->compile = './templates_c/';
    $tpl->gzipCompression = 1;
    $tpl->httpHeaders(OPT_HTML);
    // create an instance of the i18n system
    $i18n = i18n::getInstance();
    // pass it to the parser
    $tpl->setObjectI18n($i18n);
    $tpl->assign('current_date', date('d.m.Y'));
    $tpl->parse('example5.tpl');
} catch (optException $exception) {
    optErrorHandler($exception);
}