Example #1
0
 /**
  * getInstance
  * 
  * @return void
  */
 public static function getInstance()
 {
     if (!is_object(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $locale = $this->config->application->get("application/locale");
     $current = isset($locale["current"]) ? $locale["current"] : "en-US";
     $accepted = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, strpos($_SERVER["HTTP_ACCEPT_LANGUAGE"], ","));
     if (in_array($accepted, (array) $locale["accepted"])) {
         $current = $accepted;
     }
     $this->setLocale($current);
 }
Example #3
0
 protected function _init()
 {
     parent::_init();
     $this->event->register("page.render", $this, "onRender");
 }