Tak tylko nie wiedzialem jak sie do niej odwołać ale zapomnialem o helperach:
<?php
$this->_helper->layout->setLayout
?>
Mam jeszcze jedno pytanie mam nadzieje ze ostatnie, bo po zalogowaniu przez Zend_Auth_Adapter_DbTable
chce w layoutach używające helpera pokazywać dane użytkownika zalogowanygo, np przy linku wyloguj, ale jak wczytuje helper
<?php
class Zend_View_Hepler_Admin{
function Admin(){
$auth = Zend_Auth::getInstance();
$user=$auth->getIdentity();
return $user;
}
}
?>
który jest w katalogu application/views/helpers/
i wywoluje go w pliku phtml
<?php
$this->Admin();
?>
to dostaje bląd
<?php
exception 'Zend_View_Exception' with message 'helper 'Admin' not found in path' in /home/emadness/public_html/cms/library/Zend/View/Abstract.php:1004Stack trace:
#0 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(497): Zend_View_Abstract->_loadClass('helper', 'Admin')
#1 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(294): Zend_View_Abstract->getHelper('Admin')
#2 [internal function]: Zend_View_Abstract->__call('Admin', Array)
#3 /home/emadness/public_html/cms/application/views/scripts/header.phtml(19): Zend_View->Admin()
#4 /home/emadness/public_html/cms/library/Zend/View.php(46): include('/home/emadness/...')
#5 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(769): Zend_View->_run('./application/v...')
#6 /home/emadness/public_html/cms/application/views/scripts/index/index.phtml(1): Zend_View_Abstract->render('header.phtml')#
7 /home/emadness/public_html/cms/library/Zend/View.php(46): include('/home/emadness/...')
#8 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(769): Zend_View->_run('./application/v...')
#9 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(895): Zend_View_Abstract->render('index/index.pht...')
#10 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(916): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL)
#11 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(955): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /home/emadness/public_html/cms/library/Zend/Controller/Action/HelperBroker.php(161): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /home/emadness/public_html/cms/library/Zend/Controller/Action.php(512): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /home/emadness/public_html/cms/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action->dispatch('indexAction')
#15 /home/emadness/public_html/cms/library/Zend/Controller/Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /home/emadness/public_html/cms/index.php(53): Zend_Controller_Front->dispatch()
#17 {main}" exception 'Zend_View_Exception' with message 'helper 'Admin' not found in path' in /home/emadness/public_html/cms/library/Zend/View/Abstract.php:1004
Stack trace:
#0 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(497): Zend_View_Abstract->_loadClass('helper', 'Admin')
#1 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(294): Zend_View_Abstract->getHelper('Admin')
#2 [internal function]: Zend_View_Abstract->__call('Admin', Array)
#3 /home/emadness/public_html/cms/application/views/scripts/header.phtml(19): Zend_View->Admin()
#4 /home/emadness/public_html/cms/library/Zend/View.php(46): include('/home/emadness/...')
#5 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(769): Zend_View->_run('./application/v...')
#6 /home/emadness/public_html/cms/application/views/scripts/index/index.phtml(1): Zend_View_Abstract->render('header.phtml')
#7 /home/emadness/public_html/cms/library/Zend/View.php(46): include('/home/emadness/...')
#8 /home/emadness/public_html/cms/library/Zend/View/Abstract.php(769): Zend_View->_run('./application/v...')
#9 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(895): Zend_View_Abstract->render('index/index.pht...')
#10 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(916): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL)
#11 /home/emadness/public_html/cms/library/Zend/Controller/Action/Helper/ViewRenderer.php(955): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /home/emadness/public_html/cms/library/Zend/Controller/Action/HelperBroker.php(161): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /home/emadness/public_html/cms/library/Zend/Controller/Action.php(512): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /home/emadness/public_html/cms/library/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action->dispatch('indexAction')
#15 /home/emadness/public_html/cms/library/Zend/Controller/Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /home/emadness/public_html/cms/index.php(53): Zend_Controller_Front->dispatch()
#17 {main}
?>