{ if ($this->invalid()) { $this->tpl->assign('error_msg', 1); } $this->tpl->parse('test_ajax_1.tpl'); } } try { require './include.php'; $tpl = new optClass(); $tpl->loadConfig('./config.php'); $tpl->setMasterPage('master.tpl'); $validator = new opfValidator(); $opf = new opfClass($tpl, $validator->defaultParams()); $opf->createI18n('./'); $opf->handleAjax(); $form = new myForm($opf, 'form1'); if ($form->execute()) { if (!$opf->visit->ajax) { $tpl->assign('username', $opf->validator->username); $tpl->assign('email', $opf->validator->email); $tpl->assign('age', $opf->validator->age); $tpl->assign('content', $opf->validator->content); $tpl->parse('report.tpl'); } } } catch (opfException $exception) { opfErrorHandler($exception); } catch (optException $exception) { optErrorHandler($exception); }