Ejemplo n.º 1
0
/**
 * Shorthand method for calling Multilanguage::getTranslation, should be used in views.
 */
function t($data)
{
    return Multilanguage::getTranslation($data);
}
Ejemplo n.º 2
0
 /**
  * Stores data to be injected into views. The data is stored as key, value pairs.
  *
  * The "key" represents the name of the variable in the view. The value is given
  * to the keys variable.
  *
  * An array of key value pairs can be passed instead of doing one at a time.
  *
  * @param string $key The name of the variable to create in the view
  * @param mixed $value The value associated with the variable $key
  */
 public static function data($key, $value = null)
 {
     if (is_array($key)) {
         //self::$_data = array_merge(self::$_data, $key);
         foreach ($key as $k => $v) {
             self::data($k, $v);
         }
     } else {
         self::$_data[$key] = Multilanguage::getTranslation($value);
     }
 }