0
votes

I try to render a Template with this function:

public function renderLastEinsatz($lastEinsatz) {
    Zend_Loader::loadClass('Zend_View');
    $view = new Zend_View();

    $view->headline = "Letzter Einsatz";
    $view->datum = $lastEinsatz->getDatum();
    $view->ort = $lastEinsatz->getOrt();
    $view->bemerkung = $lastEinsatz->getBemerkung();
    $view->setScriptPath('/library/Feuerwehr/Templates');
    return $view->render('indexArtikel.phtml');
}

My folder is: www/ htdocs/index.php library/Feuerwehr /Templates library/Zend

I set in index.php the include path to the libraries und try to use the render function with this error code:

Fatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'indexArtikel.phtml' not found in path (/library/Feuerwehr/Templates/)' in /var/library/Zend/View/Abstract.php on line 988 ( ! ) Zend_View_Exception: script 'indexArtikel.phtml' not found in path (/library/Feuerwehr/Templates/) in /var/library/Zend/View/Abstract.php on line 988

All files are there and i can't find a solution with google, u know the answer?

1

1 Answers

1
votes

Script path is not valid.
Change it to:

$view->setScriptPath('/var/library/Feuerwehr/Templates');

or

$view->setScriptPath('../library/Feuerwehr/Templates');