public function __construct() { $this->app = \GF\App::getInstance(); $this->view = \GF\View::getInstance(); $this->config = $this->app->getConfig(); $this->input = \GF\InputData::getInstance(); }
public function index2() { $view = \GF\View::getInstance(); $view->username = '******'; $view->appendToLayout('body', 'admin.index'); $view->appendToLayout('body2', 'index'); $view->display('layouts.admin.default', array('c' => array(1, 2, 3, 4, 8)), false); }
public function index2() { $val = new \GF\Validation(); $val->setRule('url', 'http://az.c@/', '', 'wrong url')->setRule('minlength', 'http://az.c/', 50); $val->setRule('custom', 4, function ($a) { return $a % 2; }); var_dump($val->validate()); print_r($val->getErrors()); $view = \GF\View::getInstance(); $view->appendToLayout('body', 'product.index'); $view->appendToLayout('test', 'index'); $view->display('layouts.default2', array('test' => array(1, 2, 3, 4, 5, 6)), false); }
public function displayError($error) { try { $view = \GF\View::getInstance(); $view->display('errors.' . $error); } catch (\Exception $exc) { \GF\Common::headerStatus($error); echo '<h1>' . $error . '</h1>'; exit; } }