jako ze juz teoretycznie mamy wersje 1.0 choć co prawda jeszcze nie stabilna ale już coś więc pisze bo natrafiłem na jak dla mnie dziwny problem i nie mogę sobie z nim poradzić
a mianowicie mam plik bootstrap taki
<?php $time_start = getmicrotime(); require_once './lib/Zend/Loader.php'; Zend_Loader::loadClass('Zend_Controller_Front'); Zend_Loader::loadClass('Zend_Db'); Zend_Loader::loadClass('Zend_Registry'); Zend_Loader::loadClass('Zend_Session'); Zend_Loader::loadClass('Zend_Auth'); Zend_Session::start(); require(OPT_DIR.'opt.class.php'); Zend_Registry::set('db', Zend_Db::factory('PDO_Mysql', array ('host'=>'localhost','username'=>'user','password'=>'*****','dbname'=>'baza'))); Zend_Registry::set('tpl', new optClass); Zend_Loader::loadClass('Zend_Cache'); $controller = Zend_Controller_Front::getInstance(); $controller -> throwExceptions(true); $controller -> run( 'default' => './app/default/controllers/', 'admin' => './app/admin/controllers', 'Admin' => './app/admin/controllers' )); $time_end = getmicrotime(); ?>
taki sam pliki pod ZF 0.93B ładnie działa i nic nie wyrzuca
indexcontroller
<?php class IndexController extends Zend_Controller_Action{ private $db; private $tpl; public function init(){ $this -> db = Zend_Registry::get('db'); $this -> tpl = Zend_Registry::get('tpl'); $this -> tpl -> root = './templates/templates/'; $this -> tpl -> compile = './templates/templates_c/'; $this -> tpl -> assign('location', LOCATION); } public function indexAction(){ $this->start(); } private function Start(){ $auth = Zend_Auth::getInstance(); //echo'<pre>'.print_r($auth->getIdentity(),1).'</pre>'; $this -> tpl -> assign('user', $auth->getIdentity() -> username); $this -> tpl -> parse('index.tpl'); } public function noRouteAction(){ $this->_redirect('/'); } private function assign($data, $tamplate,$patch){ $this -> tpl -> root = './templates/templates/'.$patch; $this -> tpl -> compile = './templates/templates_c/'.$patch; $this -> tpl -> trace = 1; foreach($data as $key=>$val){ } $this -> tpl -> assign('location', LOCATION); return $this -> tpl -> fetch($tamplate); } } ?>
no i teraz nie wiem czemu pod pokazaną stroną mam wyrzucony wyjątek ( $controller -> throwExceptions(true); ) o takiej treści
Kod
Fatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'index/index.phtml' not found in path' in D:\serwer\www\lib\Zend\View\Abstract.php:853 Stack trace: #0 D:\serwer\www\lib\Zend\View\Abstract.php(764): Zend_View_Abstract->_script('index/index.pht...') #1 D:\serwer\www\lib\Zend\Controller\Action\Helper\ViewRenderer.php(702): Zend_View_Abstract->render('index/index.pht...') #2 D:\serwer\www\lib\Zend\Controller\Action\Helper\ViewRenderer.php(723): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL) #3 D:\serwer\www\lib\Zend\Controller\Action\Helper\ViewRenderer.php(770): Zend_Controller_Action_Helper_ViewRenderer->render() #4 D:\serwer\www\lib\Zend\Controller\Action\HelperBroker.php(160): Zend_Controller_Action_Helper_ViewRenderer->postDispatch() #5 D:\serwer\www\lib\Zend\Controller\Action.php(504): Zend_Controller_Action_HelperBroker->notifyPostDispatch() #6 D:\serwer\www\lib\Zend\Controller\Dispatcher\Standard.php(230): Zend_Con in D:\serwer\www\lib\Zend\View\Abstract.php on line 853
wiem wyjątki sobie wyrzucam ale on o tak się nie powinien pojawić Zend_View nie używam nie podoba mi się wole OPT tak samo z helperami nie ładuje nie używam zadnego bo to jest postawione specjalnie do testów
jeśli będzie throwExceptions(false) to dostaje taki błąd
Kod
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in D:\serwer\www\lib\Zend\Controller\Dispatcher\Standard.php:189 Stack trace: #0 D:\serwer\www\lib\Zend\Controller\Front.php(889): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 D:\serwer\www\lib\Zend\Controller\Front.php(229): Zend_Controller_Front->dispatch() #2 D:\serwer\www\index.php(27): Zend_Controller_Front::run(Array) #3 {main} thrown in D:\serwer\www\lib\Zend\Controller\Dispatcher\Standard.php on line 189
choć strona się wygeneruje to ja i tak pod spodem dostaje jak nie jested to drugi komunikat i juz nie wiem poprostu zgłupiałem szukałem dziś cały dzień co jest ale się nie doszukałem

może ktoś już doszedł co jest nie tak tutaj

jesli tak to bedzie wdzięczny za podzielenie sie rozwiązaniem sugestią co robie źle