public function setDefaultData($key, $val = null)
    {
        if(is_array($key))
        {
            foreach($key as $k=>$v)
            {
                $this->setDefaultData($k, $v);
            }
        }
        else
        {
            $this->defaultData[$key] = $val;
        }

        return $this;
    }
public function setDefaultData($key, $val = null)
    {
        if(is_array($key))
        {
            foreach($key as $k=>$v)
            {
                $this->setDefaultData($k, $v);
            }
        }
        else
        {
            $this->defaultData[$key] = $val;
        }

        return $this;
    }
public function setDefaultData ( $ key , $ val = null ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ k => $ v ) { $ this -> setDefaultData ( $ k , $ v ) ; } } else { $ this -> defaultData [ $ key ] = $ val ; } return $ this ; }
Set default data for every view created through this factory.
@param array|string $key
@param mixed $val
@return $this
Set default data for every view created through this factory .