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;
        }
    }