public function helloPage() { var_dump($this->request->getParams()); $env = Nomad_Environment::getEnvironment(); $this->view->os = $env->getOS(); $this->view->browser = $env->getBrowser(); Nomad_Session::getInstance()->display(Nomad_Session::getInstance()); }
/** * function to get the instantiated session object or * create a new one (singleton pattern) */ public static function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new self(); } self::$_instance->startSession(); return self::$_instance; }
<?php /** * Bootstrap.php * Creates, sets up then runs the Nomad Application * * @author Mark Hillebert * @package The Nomad Project */ header('Content-Type: text/html; charset=utf-8'); $application = Nomad_Application::getInstance(); /** setup for Nomad_Session use */ //Nomad_Session::getInstance(); $application->registerPlugin('NomadTimer'); $application->registerPlugin('Nomad_GateKeeper'); /** Set up the authorization using a custom service (/services/authlist.php) */ authlist::setAuthentication(); /** Setup Main Navigation */ $application->view->mainNavigation = NavigationMenus::createMainNavigation(); /** Setup theme changing links */ $application->view->themeLinks = NavigationMenus::themeLinks(); $params = $application->getRoute()->getRequest()->getParams(); $currentTheme = Nomad_Session::getInstance()->currentTheme; if (isset($currentTheme)) { $application->view->useTheme($currentTheme); } if (count($params) > 0) { Nomad_Session::getInstance()->currentTheme = ucfirst($params[0]); $application->view->useTheme(ucfirst($params[0])); } $application->run();
/** * Sets the current role of user. * @param $roles */ public function setRole($roles) { //@TODO Remove this dependency on sessions. if (!is_array($roles)) { $roles = func_get_args(); } Nomad_Session::getInstance()->role = $roles; }
public function sessiongetvarPage() { $mySession = Nomad_Session::getInstance(); $this->view->firstName = $mySession->firstName; }