示例#1
0
        }
        $view->results = $results;
    }
}
// end MyForm;
try {
    $tpl = new Opt_Class();
    $opf = new Opf_Class();
    $tpl->sourceDir = './templates/';
    $tpl->compileDir = './templates_c/';
    $tpl->setup();
    $view = new Opt_View('situation_2.tpl');
    $view->devFile = 'situation_2.php';
    $form = new My_Form('form1');
    $form->appendListener(new My_EventListener());
    $form->setView($view);
    $form->execute();
    $output = new Opt_Output_Http();
    $output->render($view);
} catch (Exception $e) {
    var_dump($e);
} catch (Opf_Exception $exception) {
    $handler = new Opf_ErrorHandler();
    $handler->display($exception);
} catch (Opt_Exception $exception) {
    $handler = new Opt_ErrorHandler();
    $handler->display($exception);
} catch (Opl_Exception $exception) {
    $handler = new Opl_ErrorHandler();
    $handler->display($exception);
}
示例#2
0
        }
        $view->results = $results;
    }
}
// end MyForm;
try {
    $opc = new Opc_Class();
    $tpl = new Opt_Class();
    $opf = new Opf_Class($tpl);
    $tpl->sourceDir = './templates/';
    $tpl->compileDir = './templates_c/';
    $tpl->compileMode = Opt_Class::CM_REBUILD;
    $tpl->stripWhitespaces = false;
    $tpl->gzipCompression = false;
    $tpl->setup();
    $translate = new Opc_Translate(new Opc_Translate_Adapter_Ini(array('directory' => './lang/')));
    $translate->setLanguage('en');
    $opf->setTranslationInterface($translate);
    $view = new Opt_View('situation_1.tpl');
    $view->devFile = 'situation_1.php';
    $form = new My_Form('form1');
    $form->setView($view);
    $form->execute();
    $output = new Opt_Output_Http();
    $output->render($view);
} catch (Opl_Exception $exception) {
    $handler = new Opf_ErrorHandler();
    $handler->addPort(new Opf_ErrorHandler_Port());
    $handler->addPort(new Opt_ErrorHandler_Port());
    $handler->display($exception);
}