示例#1
0
文件: Facade.php 项目: noikiy/inovi
 private static function instance()
 {
     $name = static::factory();
     if (false === App::has($name)) {
         throw new Exception("You must define " . $name . " app before use it.");
     }
     return App::make($name);
 }
示例#2
0
文件: Helper.php 项目: noikiy/inovi
 function trad($id, $default, $args = '')
 {
     $app = App::instance();
     $lang = $app->getLang();
     $translation = $lang->translate($id, $default);
     $args = eval('return array(' . $args . ');');
     if (count($args)) {
         foreach ($args as $key => $value) {
             $translation = str_replace("%{$key}%", $value, $translation);
         }
     }
     return $translation;
 }