Example #1
0
 /**
  * Get the result of an key from the languages-array
  *
  * @param string $key  the name of the key
  * @param array  $args args that can be replaced
  *
  * @return string the result value of the key
  */
 public static function language($key, $args = [])
 {
     $lang = @self::$_language[$key];
     if (!empty($lang)) {
         if (!empty($args)) {
             foreach ($args as $name => $value) {
                 $lang = String::replace('{' . $name . '}', $value, $lang);
             }
         }
         return $lang;
     }
     throw new \ExceptionLanguage('Key "' . $key . '" could\'t be found');
 }
Example #2
0
 /**
  * Initialize the view
  *
  * @param  string  $path the path of the view/template
  * @param  array   $args the arguments for the view (set)
  */
 public function __construct($path, $args = array())
 {
     $this->_data['path'] = $path;
     $this->_data['url'] = T . String::replace('.', DS, $path) . '.phtml';
     $this->set($args);
 }