src/Webtrees/Mvc/View/ViewFactory.php
public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
    {
        if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
        if(!$ctrl) throw new \Exception('Base Controller not defined');
        if(!$view_name) throw new \Exception('View not defined');
        
        $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl);
        $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View';       
        if(!class_exists($view_class)) throw new \Exception('View does not exist');
        
        return new $view_class($ctrl, $data);
    }
public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
    {
        if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
        if(!$ctrl) throw new \Exception('Base Controller not defined');
        if(!$view_name) throw new \Exception('View not defined');
        
        $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl);
        $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View';       
        if(!class_exists($view_class)) throw new \Exception('View does not exist');
        
        return new $view_class($ctrl, $data);
    }
public function makeView ( $ view_name , MvcController $ mvc_ctrl , BaseController $ ctrl , ViewBag $ data ) { if ( ! $ mvc_ctrl ) throw new \ Exception ( 'Mvc Controller not defined' ) ; if ( ! $ ctrl ) throw new \ Exception ( 'Base Controller not defined' ) ; if ( ! $ view_name ) throw new \ Exception ( 'View not defined' ) ; $ mvc_ctrl_refl = new \ ReflectionObject ( $ mvc_ctrl ) ; $ view_class = $ mvc_ctrl_refl -> getNamespaceName ( ) . '\\Views\\' . $ view_name . 'View' ; if ( ! class_exists ( $ view_class ) ) throw new \ Exception ( 'View does not exist' ) ; return new $ view_class ( $ ctrl , $ data ) ; }
Return the view specified by the controller and view name, using data from the ViewBag

@param string $view_name
@param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
@param \Fisharebest\Webtrees\Controller\BaseController $ctrl
@param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
@return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
@throws \Exception
Return the view specified by the controller and view name using data from the ViewBag