Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 /**
  * 返回一个语言包语句
  *
  * @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;
 }