public function init($config, $options = array()) { parent::init($config, $options); $this->setLogger(new \Gelembjuk\Logger\FileLogger(array('logfile' => $this->getOption('tmproot') . 'log.txt', 'groupfilter' => $this->getConfig('loggingfilter')))); }
return true; } protected function viewForm() { // display form page $this->htmltemplate = 'form'; return true; } protected function viewData() { // display form page $this->htmltemplate = 'data'; // template name // usually it can be loaded from a Model $this->viewdata['data'] = array(array('name' => 'User1', 'email' => '*****@*****.**'), array('name' => 'User2', 'email' => '*****@*****.**'), array('name' => 'User3', 'email' => '*****@*****.**')); return true; } protected function beforeDisplay() { // set some extra information for any page if ($this->responseformat == 'html') { // only if this is html format to display $this->viewdata['applicationtitle'] = 'Demo application'; // include more data that should be displayed on any page of a site } return true; } } $application = \Gelembjuk\WebApp\Application::getInstance(); $application->init(new appConfig(), $options); $application->action();