コード例 #1
0
ファイル: Context.php プロジェクト: appcia/webwork
 /**
  * @param Locale $locale
  *
  * @return $this
  */
 public function setLocale($locale)
 {
     if (!$locale instanceof Locale) {
         $locale = Locale::objectify($locale, array($this));
     }
     $this->locale = $locale;
     return $this;
 }
コード例 #2
0
ファイル: Switcher.php プロジェクト: appcia/webwork-core
 /**
  * Change current locale
  *
  * @param string $code Locale code 'en_US' etc
  *
  * @return $this
  */
 public function change($code)
 {
     $this->locale->setActive($code);
     $this->data['active'] = $this->locale->getActive();
     return $this;
 }