Пример #1
0
 public static function getInstance()
 {
     if (self::$intance == null) {
         self::$intance = new self();
     }
     return self::$intance;
 }
Пример #2
0
 /**
  * Constructor of the class
  * @access public
  */
 public function __construct()
 {
     //Get the Yasui_Router from the registry
     $this->_router = Yasui_Registry::get('router');
     //Instantiate the Yasui_View object
     $this->_view = Yasui_View::getInstance();
     //Adds init action to execute before the main action
     $this->addPreAction('init');
     //Adds preDispatch action to execute before the main action
     $this->addPreAction('preDispatch');
     //Adds the renderView action to execute after the main action
     $this->addPostAction('renderView');
 }
Пример #3
0
 /**
  * Constructor of the class
  * @access public
  */
 public function __construct()
 {
     //Instantiate the Yasui_View
     $this->_view = Yasui_View::getInstance();
 }
Пример #4
0
<?php

set_include_path(get_include_path() . PATH_SEPARATOR . 'library/');
require 'BootStrap.php';
Yasui_Registry::set('config', new Yasui_Config('config.ini', 'ini'));
$auth = Yasui_Auth::getInstance();
$authAdapter = $auth->getAdapter('DB');
$authAdapter->setAuthLocation('users')->setIdentityColumn('email')->setCredentialColumn('password')->setCredentialCrypt('md5');
$view = Yasui_View::getInstance();
$view->addHelperPath('application/views/helpers/');
$view->setPluginConf('menuAuth', array('authAdapter' => $authAdapter));
$view->authenticate = $authAdapter->isAuthenticate();
$front->dispatch();