src/Budkit/Routing/Controller.php
public function setView($view)
    {

        if (class_exists($view)) {
            //if we already have a default view
            $values = [];

            //grab all its parameters and store in parameters
            if (isset($this->view) && $this->view instanceof View) {

                $values = $this->view->getDataArray();
                $layout = $this->view->getLayout();

                //Load the newView;
                $this->view = $this->loadView($view, $values);

                if (!empty($layout)) {
                    $this->view->setLayout($layout);
                }
            }

            return $this;

        } else if (is_string($view)) {

            $this->response->addContent($view); //so that $this->view("Hi There");  will output Hi There;

            return $this;

        }

        return false; //no view set;
    }
public function setView($view)
    {

        if (class_exists($view)) {
            //if we already have a default view
            $values = [];

            //grab all its parameters and store in parameters
            if (isset($this->view) && $this->view instanceof View) {

                $values = $this->view->getDataArray();
                $layout = $this->view->getLayout();

                //Load the newView;
                $this->view = $this->loadView($view, $values);

                if (!empty($layout)) {
                    $this->view->setLayout($layout);
                }
            }

            return $this;

        } else if (is_string($view)) {

            $this->response->addContent($view); //so that $this->view("Hi There");  will output Hi There;

            return $this;

        }

        return false; //no view set;
    }
public function setView ( $ view ) { if ( class_exists ( $ view ) ) { //if we already have a default view $ values = [ ] ; //grab all its parameters and store in parameters if ( isset ( $ this -> view ) && $ this -> view instanceof View ) { $ values = $ this -> view -> getDataArray ( ) ; $ layout = $ this -> view -> getLayout ( ) ; //Load the newView; $ this -> view = $ this -> loadView ( $ view , $ values ) ; if ( ! empty ( $ layout ) ) { $ this -> view -> setLayout ( $ layout ) ; } } return $ this ; } else if ( is_string ( $ view ) ) { $ this -> response -> addContent ( $ view ) ; //so that $this->view("Hi There");  will output Hi There; return $ this ; } return false ; //no view set; }
Sets the view for this controller action

@param $view
@return $this|bool
Sets the view for this controller action