public function appendByRef($name, &$val, $merge = false)
    {
        if (isset($this->data[$name]) && !is_array($this->data[$name])) {
            settype($this->data[$name], 'array');
        }

        if ($merge === true && is_array($val)) {
            foreach ($val as $key => &$value) {
                $this->data[$name][$key] = &$value;
            }
        } else {
            $this->data[$name][] = &$val;
        }
    }
public function appendByRef($name, &$val, $merge = false)
    {
        if (isset($this->data[$name]) && !is_array($this->data[$name])) {
            settype($this->data[$name], 'array');
        }

        if ($merge === true && is_array($val)) {
            foreach ($val as $key => &$value) {
                $this->data[$name][$key] = &$value;
            }
        } else {
            $this->data[$name][] = &$val;
        }
    }
public function appendByRef ( $ name , & $ val , $ merge = false ) { if ( isset ( $ this -> data [ $ name ] ) && ! is_array ( $ this -> data [ $ name ] ) ) { settype ( $ this -> data [ $ name ] , 'array' ) ; } if ( $ merge === true && is_array ( $ val ) ) { foreach ( $ val as $ key => & $ value ) { $ this -> data [ $ name ] [ $ key ] = & $ value ; } } else { $ this -> data [ $ name ] [ ] = & $ val ; } }
Appends a value by reference to the data object.

@param string $name  the index to use, i.e. a value assigned to "foo" will be
accessible in the template through {$foo}
@param mixed  $val   the value to append by reference
@param bool   $merge true to merge data or false to append, defaults to false
Appends a value by reference to the data object .