Пример #1
0
 /**
  * Assigns a template variable with a value
  * @param string|array $key template file reference
  * @param mixed $val (primitive types or \Jazz\Output
  * @throws \InvalidArgumentException
  */
 public function assign($key, $val = null)
 {
     if (is_array($key)) {
         parent::assign($key);
     } else {
         // verify precondition
         if ($val !== null && !is_bool($val) && !is_string($val) && !is_numeric($val) && !$val instanceof \Jazz\IOutput) {
             throw new \InvalidArgumentException('val');
         }
         parent::assign($key, $val);
     }
 }