code: public function setRenderView($viewPath, $params)
      {
          //Set volt tempalte enging and specify the cache path
          $this->setViewEngines([
              '.volt' => function ($view = null) {
                  $volt = new Volt($view);
  
                  $volt->setOptions([
                      'compiledPath' => APP_PATH . '/cache/volt/',
                      'compiledSeparator' => '_',
                      'compileAlways' => !$this->getDI()->get('config')->application->production,
                  ]);
  
                  return $volt;
              }
          ]);
  
          $view = $this->getView();
  
          $content = $view->render($viewPath, $params);
          return $content;
      }
docs: Renders a view
  
  @param $viewPath
  @param $params
  @param null $viewsDir
  
  @return string