コード例 #1
0
 /**
  * Create a new Controller instance.
  */
 public function __construct()
 {
     parent::__construct();
     // Setup the used Template to default, if it is not already defined.
     if (!isset($this->template)) {
         $this->template = Config::get('app.template');
     }
     // Initialise the Language object.
     if ($this->language !== false) {
         $this->language = Language::instance('legacy_api', LANGUAGE_CODE);
     }
     // Setup the (legacy) Middleware.
     $this->beforeFilter('@callLegacyBefore');
     $this->afterFilter('@callLegacyAfter');
 }
コード例 #2
0
 /**
  * Get the formatted and translated message back with Domain.
  *
  * @param string $domain
  * @param string $message
  * @param mixed $args
  * @return string|void
  */
 function __d($domain, $message, $args = null)
 {
     if (!$message) {
         return '';
     }
     //
     $params = func_num_args() === 3 ? (array) $args : array_slice(func_get_args(), 2);
     return Language::instance($domain)->translate($message, $params);
 }