Exemplo n.º 1
0
    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
            if ($this->viewdata['message'] == '') {
                $this->viewdata['message'] = $this->router->getInput('message');
            }
            $this->viewdata['applicationtitle'] = 'Demo application';
        }
        return true;
    }
}
$application = MyApplication::getInstance();
$application->init(new appConfig(), $options);
$application->action();