Airship\Engine\Lens::append PHP Method

append() public method

Maintain an array of values for later rendering, appending the supplied value.
public append ( string $key, mixed $val ) : self
$key string Index
$val mixed Value
return self
    public function append(string $key, $val) : self
    {
        if (!isset($this->stored[$key])) {
            $this->stored[$key] = [];
        } elseif (!is_array($this->stored[$key])) {
            // Let's store the existing value as the first index
            $this->stored[$key] = [$this->stored[$key]];
        }
        $this->stored[$key][] = $val;
        return $this;
    }