Example #1
0
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     self::$instance->clearAllAssign();
     return self::$instance;
 }
Example #2
0
 protected static function factory()
 {
     $config = Hayate_Config::getInstance()->get('view', array('name' => 'native'));
     if (isset($config['name'])) {
         switch ($config['name']) {
             case 'smarty':
                 return Hayate_View_Smarty::getInstance();
             case 'native':
                 return Hayate_View_Native::getInstance();
             default:
                 throw new Hayate_View_Exception(_('Supported views are "smarty" and "native".'));
         }
     }
     throw new Hayate_View_Exception(_('View name is missing.'));
 }