public function addCallback($callback, $data = [], $region = "main", $sort = 0)
    {
        $view = $this->di->get("view");
        $view->set(["callback" => $callback], $data, $sort, "callback");
        $view->setDI($this->di);
        $this->views[$region][] = $view;

        return $this;
    }
public function addCallback($callback, $data = [], $region = "main", $sort = 0)
    {
        $view = $this->di->get("view");
        $view->set(["callback" => $callback], $data, $sort, "callback");
        $view->setDI($this->di);
        $this->views[$region][] = $view;

        return $this;
    }
public function addCallback ( $ callback , $ data = [ ] , $ region = "main" , $ sort = 0 ) { $ view = $ this -> di -> get ( "view" ) ; $ view -> set ( [ "callback" => $ callback ] , $ data , $ sort , "callback" ) ; $ view -> setDI ( $ this -> di ) ; $ this -> views [ $ region ] [ ] = $ view ; return $ this ; }
Add a callback to be rendered as a view.

@param string $callback function to call to get the content of the view
@param array  $data     variables to make available to the view, default is empty
@param string $region   which region to attach the view
@param int    $sort     which order to display the views

@return $this
Add a callback to be rendered as a view .