Example #1
0
 /**
  * Fetch a child template's content
  *
  * @param string $tpl
  * @param array $vars
  *
  * @return string
  */
 public function partial(string $tpl, array $vars = [])
 {
     if ($tpl[0] == '/') {
         $tpl = $this->app->getDir('view') . $tpl;
     } else {
         $dir = dirname($this->tpl);
         $tpl = $dir . '/' . $tpl;
     }
     $view = new WisView();
     $view->init($this->app);
     $view->setArray($vars);
     return $view->build($tpl);
 }