public function setData($data = null, $render = true)
    {
        // Store data (reached) from model in this view!
        $this->data = $data;

        // Assume null result out if render = false
        $result = null;

        // Do render the view?
        if (true === $render) {
            // Lookup specific renderer per view! view:action
            $specificViewRenderer = '__render'.ucfirst($this->getRoute()->getPresenter());

            // check if specific renderer is callable
            if (method_exists($this, $specificViewRenderer)) {
                // Call renderer
                $result = $this->{$specificViewRenderer}($this->data);
            } elseif (method_exists($this, '__render')) {
                // Always check fallback -> one generic __render for all actions used by Doozr for REST API
                $result = $this->{'__render'}($this->data);
            }
        }

        return $result;
    }
public function setData($data = null, $render = true)
    {
        // Store data (reached) from model in this view!
        $this->data = $data;

        // Assume null result out if render = false
        $result = null;

        // Do render the view?
        if (true === $render) {
            // Lookup specific renderer per view! view:action
            $specificViewRenderer = '__render'.ucfirst($this->getRoute()->getPresenter());

            // check if specific renderer is callable
            if (method_exists($this, $specificViewRenderer)) {
                // Call renderer
                $result = $this->{$specificViewRenderer}($this->data);
            } elseif (method_exists($this, '__render')) {
                // Always check fallback -> one generic __render for all actions used by Doozr for REST API
                $result = $this->{'__render'}($this->data);
            }
        }

        return $result;
    }
public function setData ( $ data = null , $ render = true ) { // Store data (reached) from model in this view! $ this -> data = $ data ; // Assume null result out if render = false $ result = null ; // Do render the view? if ( true === $ render ) { // Lookup specific renderer per view! view:action $ specificViewRenderer = '__render' . ucfirst ( $ this -> getRoute ( ) -> getPresenter ( ) ) ; // check if specific renderer is callable if ( method_exists ( $ this , $ specificViewRenderer ) ) { // Call renderer $ result = $ this -> { $ specificViewRenderer } ( $ this -> data ) ; } elseif ( method_exists ( $ this , '__render' ) ) { // Always check fallback -> one generic __render for all actions used by Doozr for REST API $ result = $ this -> { '__render' } ( $ this -> data ) ; } } return $ result ; }
This method is the setter for the data to use in the action method.

@param mixed $data   The data to set
@param bool  $render Controls if renderer (if exist) should be called (set to TRUE)

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if successful, otherwise FALSE
This method is the setter for the data to use in the action method .