public function assign($name, $val = null)
    {
        if (is_array($name)) {
            reset($name);
            foreach ($name as $k => $v){
                $this->data[$k] = $v;
            }
        } else {
            $this->data[$name] = $val;
        }
    }
public function assign($name, $val = null)
    {
        if (is_array($name)) {
            reset($name);
            foreach ($name as $k => $v){
                $this->data[$k] = $v;
            }
        } else {
            $this->data[$name] = $val;
        }
    }
public function assign ( $ name , $ val = null ) { if ( is_array ( $ name ) ) { reset ( $ name ) ; foreach ( $ name as $ k => $ v ) { $ this -> data [ $ k ] = $ v ; } } else { $ this -> data [ $ name ] = $ val ; } }
Assigns a value or an array of values to the data object.

@param array|string $name an associative array of multiple (index=>value) or a string
that is 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 assign, or null if $name was an array
Assigns a value or an array of values to the data object .