public function viewData($key=null, $value=null)
    {
        $view = $this->getView();
        if (!$key) {
            return $view->getData();
        } elseif (is_null($value) && is_string($key)) {
            $viewData = $view->getData();
            return isset($viewData[$key]) ? $viewData[$key] : null;
        } else {
            $view->setData($key, $value);
            return $this;
        }
    }
public function viewData($key=null, $value=null)
    {
        $view = $this->getView();
        if (!$key) {
            return $view->getData();
        } elseif (is_null($value) && is_string($key)) {
            $viewData = $view->getData();
            return isset($viewData[$key]) ? $viewData[$key] : null;
        } else {
            $view->setData($key, $value);
            return $this;
        }
    }
public function viewData ( $ key = null , $ value = null ) { $ view = $ this -> getView ( ) ; if ( ! $ key ) { return $ view -> getData ( ) ; } elseif ( is_null ( $ value ) && is_string ( $ key ) ) { $ viewData = $ view -> getData ( ) ; return isset ( $ viewData [ $ key ] ) ? $ viewData [ $ key ] : null ; } else { $ view -> setData ( $ key , $ value ) ; return $ this ; } }
get or set view data
@param  string|array|Collection $key
@param  mixed        $value
@return \Wslim\Common\Collection|static if no params then return viewData, if assign param then set view data and return static
get or set view data