Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Problem z wgraniem zend framework
szczabik
post 5.02.2010, 13:38:28
Post #1





Grupa: Zarejestrowani
Postów: 226
Pomógł: 1
Dołączył: 13.05.2008

Ostrzeżenie: (0%)
-----



Witam

Zaczynam dopiero przygodę z zend
framework i od razu na początku pojawiły się problemy z wgraniem frameworka.


Mam serwer postawiony za pomocą
WebServ.

Mam
następującą strukturę katalogów

zf-tutorial/ /application /controllers /models /views /filters /helpers /scripts /library /public /images /scripts /styles
W folderze zf-tutorial utworzyłem plik .htaccess z zawartością
Kod
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Oraz plik index.php z zawartością

  1. <?php
  2. error_reporting(E_ALL|E_STRICT);
  3. date_default_timezone_set('Europe/London');
  4. set_include_path('.' . PATH_SEPARATOR . './library'
  5. . PATH_SEPARATOR . './application/models/'
  6. . PATH_SEPARATOR . get_include_path());
  7.  
  8. include "Zend/Loader.php";
  9. Zend_Loader::loadClass('Zend_Controller_Front');
  10.  
  11. // setup controller
  12. $frontController = Zend_Controller_Front::getInstance();
  13. $frontController->throwExceptions(true);
  14. $frontController->setControllerDirectory('./application/controllers');
  15.  
  16. // run!
  17. $frontController->dispatch();



Oraz plik IndexController.php w folderze application\controllers\ IndexController.php
O zawartości

  1.  
  2. class IndexController extends Zend_Controller_Action
  3. {
  4.  
  5. public function init()
  6. {
  7. /* Initialize action controller here */
  8. }
  9.  
  10. public function indexAction()
  11. {
  12. echo 'test';
  13. }
  14.  
  15.  
  16. }


I wywala mi błąd

Kod
Fatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'index/index.phtml' not found in path (.\application\views\scripts\)' in C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\View\Abstract.php:976 Stack trace: #0 C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\View\Abstract.php(876): Zend_View_Abstract->_script('index/index.pht...') #1 C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(897): Zend_View_Abstract->render('index/index.pht...') #2 C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(918): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL) #3 C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(957): Zend_Controller_Action_Helper_ViewRenderer->render() #4 C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\Controller\Action\HelperBroker.php(277): Zend_Controller_Actio in C:\Program Files\WebServ\httpd-users\zf-tutorial\library\Zend\View\Abstract.php on line 976


Proszę o pomoc.





Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
nospor
post 5.02.2010, 13:40:48
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
'script 'index/index.phtml' not found in path
Nie utworzyłes pliku ze skryptem - plik ten odpowiada za to co sie wyswietla.
W zendzie z echo raczej sie nie korzysta w kontrolerach. No ale o tym masz napisane w tutku zenda.


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
phpion
post 5.02.2010, 13:41:32
Post #3





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Nie utworzyłeś pliku widoku, o czym ładnie informuje fragment komunikatu:
Cytat
'script 'index/index.phtml' not found in path (.\application\views\scripts\)'

Masz tam podaną nazwę pliku oraz lokalizację, pod którą powinien się on znaleźć.
Go to the top of the page
+Quote Post
szczabik
post 5.02.2010, 15:00:00
Post #4





Grupa: Zarejestrowani
Postów: 226
Pomógł: 1
Dołączył: 13.05.2008

Ostrzeżenie: (0%)
-----


Dziękuje bardzo. Bardzo mi pomogliście.


Ten post edytował szczabik 5.02.2010, 15:03:45
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 20.06.2025 - 18:47