public function assign($key, $value = null){

        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } else {
            $this->data[$key] = $value;

            if(!isset($this->{$key})){
                $this->{$key} = $this->data[$key];
            }
        }
    }
public function assign($key, $value = null){

        if (is_array($key)) {
            $this->data = array_merge($this->data, $key);
        } else {
            $this->data[$key] = $value;

            if(!isset($this->{$key})){
                $this->{$key} = $this->data[$key];
            }
        }
    }
public function assign ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { $ this -> data = array_merge ( $ this -> data , $ key ) ; } else { $ this -> data [ $ key ] = $ value ; if ( ! isset ( $ this -> { $ key } ) ) { $ this -> { $ key } = $ this -> data [ $ key ] ; } } }
Assign data to template and controller

@param $key
@param $value
Assign data to template and controller