Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF] Problem z routingiem, Domyślny modół się odpala ale inne juz nie :/
orideith
post 7.07.2008, 13:53:25
Post #1





Grupa: Zarejestrowani
Postów: 72
Pomógł: 1
Dołączył: 21.07.2006

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


Witam mam taki problem z ZF chciałem ustawić 2 moduły jeden admin drugi domyślny, w którym miała by być strona docelowa ale niestety to niedziała.

Bootstrap wygląda tak (wycinek)

  1. <?php
  2. $base = '/';
  3. $frontController = Zend_Controller_Front::getInstance();
  4. $frontController->setBaseUrl($base);
  5. $frontController->throwExceptions(true);
  6. $frontController->setControllerDirectory(
  7. array('default' => './application/default/controllers','admin'=> './application/admin/controllers')
  8. );
  9. $route = new Zend_Controller_Router_Route( ':module/:controller/:action/*', array('module' => 'default', 'controller' => 'index', 'action' => 'index'));
  10. $route_admin = new Zend_Controller_Router_Route( ':module/:controller/:action/*', array('module' => 'admin', 'controller' => 'admin', 'action' => 'index'));
  11. $router = $frontController->getRouter();
  12. $router->addRoute('default', $route);
  13. $router->addRoute('admin', $route_admin);
  14. $frontController->setRouter($router);
  15.  
  16. // run!
  17. $frontController->dispatch();
  18. ?>


i tak jeżeli odpale http://localhost/default/index/index to odpala mi sie IndexController z katalogu /application/default/controllers/IndexController.php i tu jest ok zgodnie z opisem na http://framework.zend.com/manual/en/zend.c...routes.standard głównie punkt 7.5.4 tak jak jest opisane

ale jak chce odpalić http://localhost/admin/admin/index (gdzie jest /application/admin/controllers/AdminController.php) to dostaje błąd typu
  1. <?php
  2. Zend_Controller_Dispatcher_Exception: Invalid controller class ("Admin_AdminController") in G:wwwDentistica_cmslibraryZendControllerDispatcherStandard.php on line 353
  3.  
  4. [tak to z Xdebug wyglada]
  5.  
  6. $file = string 'AdminController.php' (length=19)
  7. $loadFile = string './application/admin/controllersAdminController.php' (length=51)
  8. $finalClass = string 'Admin_AdminController' (length=21)
  9. $dispatchDir = string './application/admin/controllers' (length=31)
  10. $className = string 'AdminController' (length=15)
  11. $dir = string './application/admin/controllers' (length=31)
  12. ?>


I teraz pytanie co jest nie tak próbowałem na wiele sposobów ale nie wiem czemu nie działa.

Będę wdzięczny za podpowiedź podejrzewam, że nie wiele trzeba tu zmienić ale nie wiem gdzie dokładnie

Ten post edytował orideith 7.07.2008, 20:36:16


--------------------
projektowanie stron warszawa ::: projektowanie www ::: projekty www
Go to the top of the page
+Quote Post

Posty w temacie


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: 14.08.2025 - 14:29