public function before() { if ($this->request->headers('x-xhr-referer')) { $referer = $this->request->headers('x-xhr-referer'); $this->request->referrer($referer); $this->response->headers('X-XHR-Current-Location', $this->request->uri()); } $this->init(); I18n::setup(); }
/** * 返回一个语言包语句 * * @param string $string * @return string */ public static function get($string) { $string = trim($string); if (isset(I18n::$lang[Core::$project][$string])) { return I18n::$lang[Core::$project][$string]; } # 初始化 if (!isset(I18n::$is_setup[Core::$project])) { I18n::setup(); } return isset(I18n::$lang[Core::$project][$string]) ? I18n::$lang[Core::$project][$string] : $string; }