/** * getInstance * * @return void */ public static function getInstance() { if (!is_object(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
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); }
protected function _init() { parent::_init(); $this->event->register("page.render", $this, "onRender"); }