src/Mvc/View/Template.php
/**
	 * Adds a value to a collection, collection will be created if it does not already exist
	 * @param string $key The collection key
	 * @param mixed $value
	 * @throws Exception
	 */
Adds a value to a collection, collection will be created if it does not already exist
@param string $key The collection key
@param mixed $value
@throws Exception
Adds a value to a collection collection will be created if it does not already exist @param string $key The collection key @param mixed $value @throws Exception
public function add($key, $value) {
		$this->validateValue($value);
		if (!isset($this->variables[$key])) {
			$this->variables[$key] = [];
		}
		if (!is_array($this->variables[$key])) {
			$this->variables[$key] = [$this->variables[$key]];
		}
		$this->variables[$key][] = $value;
	}
public function add ( $ key , $ value ) { $ this -> validateValue ( $ value ) ; if ( ! isset ( $ this -> variables [ $ key ] ) ) { $ this -> variables [ $ key ] = [ ] ; } if ( ! is_array ( $ this -> variables [ $ key ] ) ) { $ this -> variables [ $ key ] = [ $ this -> variables [ $ key ] ] ; } $ this -> variables [ $ key ] [ ] = $ value ; }
Adds a value to a collection, collection will be created if it does not already exist
 @param string $key The collection key
 @param mixed $value
 @throws Exception
Adds a value to a collection collection will be created if it does not already exist @param string $key The collection key @param mixed $value @throws Exception