Randy
27.02.2007, 19:02
Hallo zusammen,
ich habe bei einem Projekt ZF 0.6 genutzt. Jetzt habe ich ein neuen mit ZF 0.8 begonnen, und habe gleich mal eine dickes Problem. Die Controller funktionieren irgenwie nicht mehr.
Folgende Bootstrap und Index.php:
<?PHP
error_reporting(E_ALL);
set_include_path('application/lib/');
require_once 'Zend.php';
function __autoload($class)
{
Zend::loadClass($class);
}
//Initialisierung von Zend_Filter_Input als $post & $get
$post = new Zend_Filter_Input($_POST);
Zend::register('post', $post);
$get = new Zend_Filter_Input($_GET);
Zend::register('get', $get);
//Initialisierung von Zend_Filter als $filter
$filter = new Zend_Filter();
Zend::register('filter', $filter);
//Initialisierung von Zend_Mail als $mail
$mail = new Zend_Mail('utf-8');
Zend::register('mail', $mail);
//Initialisierung von Zend_View als $view
$view = new Zend_View();
$view->setScriptPath('/application/usr/views');
Zend::register('view', $view);
//Initialisierung des NoRoute Controllers
class No_Route_Plugin extends Zend_Controller_Plugin_Abstract
{
public function preDispatch($request)
{
$dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
if (!$dispatcher->isDispatchable($request))
{
$request->setControllerName($dispatcher->getDefaultController())
->setActionName('noroute')
->setDispatched(false);
}
}
}
$router = new Zend_Controller_Router_Rewrite();
//Initialisierung von Zend_Controller als $controller
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory('application/usr/controllers');
$controller->setRouter($router);
$controller->throwExceptions(true);
$controller->setBaseUrl('/');
$controller->registerPlugin(new No_Route_Plugin() );
Zend::register('controller', $controller);
$controller->dispatch();
?>
<?php
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo"Index Controller";
//echo $view->render('404.php');
}
public function __call($methodName, $args){
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo "__call";
//echo $view->render('404.php');
}
public function norouteAction(){
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo "noroute";
//echo $view->render('404.php');
}
}
?>
Und kriege folgende Fehlermeldung:
Warning: Zend::include_once(application/usr/controllers\IndexController.php) [function.Zend-include-once]: failed to open stream: No such file or directory in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 188
Warning: Zend::include_once() [function.include]: Failed opening 'application/usr/controllers\IndexController.php' for inclusion (include_path='application/lib/') in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 188
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "IndexController.php" was not found.' in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php:175 Stack trace: #0 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php(103): Zend::loadFile('IndexController...', Array, true) #1 C:\Servers\xampp\htdocs\counter\index.php(7): Zend::loadClass('IndexController') #2 [internal function]: __autoload('IndexController') #3 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Dispatcher\Standard.php(241): class_exists('IndexController') #4 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Dispatcher\Standard.php(190): Zend_Controller_Dispatcher_Standard->loadClass('IndexController') #5 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Front.php(750): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 C:\Servers\xampp\htdocs\counter\index.php(47): Zend_Controller_Front->dispatch() #7 {main} thrown in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 175
Ich weiß schon dass die IndexController.php nicht gefunden wird, obwohl sie in application/usr/controllers liegt...kann da jemand helfen ?
ich habe bei einem Projekt ZF 0.6 genutzt. Jetzt habe ich ein neuen mit ZF 0.8 begonnen, und habe gleich mal eine dickes Problem. Die Controller funktionieren irgenwie nicht mehr.
Folgende Bootstrap und Index.php:
<?PHP
error_reporting(E_ALL);
set_include_path('application/lib/');
require_once 'Zend.php';
function __autoload($class)
{
Zend::loadClass($class);
}
//Initialisierung von Zend_Filter_Input als $post & $get
$post = new Zend_Filter_Input($_POST);
Zend::register('post', $post);
$get = new Zend_Filter_Input($_GET);
Zend::register('get', $get);
//Initialisierung von Zend_Filter als $filter
$filter = new Zend_Filter();
Zend::register('filter', $filter);
//Initialisierung von Zend_Mail als $mail
$mail = new Zend_Mail('utf-8');
Zend::register('mail', $mail);
//Initialisierung von Zend_View als $view
$view = new Zend_View();
$view->setScriptPath('/application/usr/views');
Zend::register('view', $view);
//Initialisierung des NoRoute Controllers
class No_Route_Plugin extends Zend_Controller_Plugin_Abstract
{
public function preDispatch($request)
{
$dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
if (!$dispatcher->isDispatchable($request))
{
$request->setControllerName($dispatcher->getDefaultController())
->setActionName('noroute')
->setDispatched(false);
}
}
}
$router = new Zend_Controller_Router_Rewrite();
//Initialisierung von Zend_Controller als $controller
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory('application/usr/controllers');
$controller->setRouter($router);
$controller->throwExceptions(true);
$controller->setBaseUrl('/');
$controller->registerPlugin(new No_Route_Plugin() );
Zend::register('controller', $controller);
$controller->dispatch();
?>
<?php
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo"Index Controller";
//echo $view->render('404.php');
}
public function __call($methodName, $args){
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo "__call";
//echo $view->render('404.php');
}
public function norouteAction(){
$view = Zend::registry('view');
$controller = Zend::registry('controller');
echo "noroute";
//echo $view->render('404.php');
}
}
?>
Und kriege folgende Fehlermeldung:
Warning: Zend::include_once(application/usr/controllers\IndexController.php) [function.Zend-include-once]: failed to open stream: No such file or directory in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 188
Warning: Zend::include_once() [function.include]: Failed opening 'application/usr/controllers\IndexController.php' for inclusion (include_path='application/lib/') in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 188
Fatal error: Uncaught exception 'Zend_Exception' with message 'File "IndexController.php" was not found.' in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php:175 Stack trace: #0 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php(103): Zend::loadFile('IndexController...', Array, true) #1 C:\Servers\xampp\htdocs\counter\index.php(7): Zend::loadClass('IndexController') #2 [internal function]: __autoload('IndexController') #3 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Dispatcher\Standard.php(241): class_exists('IndexController') #4 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Dispatcher\Standard.php(190): Zend_Controller_Dispatcher_Standard->loadClass('IndexController') #5 C:\Servers\xampp\htdocs\counter\application\lib\Ze nd\Controller\Front.php(750): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #6 C:\Servers\xampp\htdocs\counter\index.php(47): Zend_Controller_Front->dispatch() #7 {main} thrown in C:\Servers\xampp\htdocs\counter\application\lib\Ze nd.php on line 175
Ich weiß schon dass die IndexController.php nicht gefunden wird, obwohl sie in application/usr/controllers liegt...kann da jemand helfen ?