Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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;
 }