Hulp met Zend Framework
De error die ik terug krijg:
Code (php)
1
2
3
2
3
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /home/allard/domains/.../public_html/library/Zend/Controller/Dispatcher/Standard.php:248 Stack trace: #0 /home/allard/domains
/.../public_html/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /home/allard/domains/.../public_html
/index.php(19): Zend_Controller_Front->dispatch() #2 {main} thrown in /home/allard/domains/.../public_html/library/Zend/Controller/Dispatcher/Standard.php on line 248
/.../public_html/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /home/allard/domains/.../public_html
/index.php(19): Zend_Controller_Front->dispatch() #2 {main} thrown in /home/allard/domains/.../public_html/library/Zend/Controller/Dispatcher/Standard.php on line 248
Mijn index.php:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
//full error reporting
error_reporting(E_ALL);
set_include_path( '.' . PATH_SEPARATOR . './library/' .
PATH_SEPARATOR . get_include_path() );
//include zend loader
include_once('Zend/Loader.php');
//load the classes
Zend_Loader::loadClass('Zend_Controller_Front');
//configure the front controller
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory('./application/controllers');
//run the conroller
$controller->dispatch();
//show te renderer
$controller->setParam('noViewRenderer' , true);
?>
//full error reporting
error_reporting(E_ALL);
set_include_path( '.' . PATH_SEPARATOR . './library/' .
PATH_SEPARATOR . get_include_path() );
//include zend loader
include_once('Zend/Loader.php');
//load the classes
Zend_Loader::loadClass('Zend_Controller_Front');
//configure the front controller
$controller = Zend_Controller_Front::getInstance();
$controller->setControllerDirectory('./application/controllers');
//run the conroller
$controller->dispatch();
//show te renderer
$controller->setParam('noViewRenderer' , true);
?>
Mijn IndexController.php:
Code (php)
Kan je de relevante code ook in dit topic tonen, want straks doet je image het niet meer en is dit topic hopeloos geworden.
Edit:
Ik heb weer een andere error. De bovenstaande is al weer weg. Deze is wel wat korter, maar weet iemand de oorzaak? En misschien ook een oplossing?
De error die ik terug krijg:
Code (php)
1
Fatal error: Class 'Zend_Controller_Action' not found in /home/allard/domains/.../public_html/application/controllers/IndexController.php on line 2
IndexController.php
Code (php)
Welke versie ZF gebruik je? Want ik kan je sterk de laatste release aanraden met de Zend_Application class.
Ik gebruik de meest recente versie. Wel gebruik ik de minimal versie. Kun je me misschien verder helpen?
Edit:
Ik heb hem al werkend gekregen, toch bedankt allemaal. Tip, het lukte me met deze code:
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
// load the classes
Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Loader::loadClass('Zend_Loader_Autoloader');
// set up autoloader instance
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Zend_');
Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Loader::loadClass('Zend_Loader_Autoloader');
// set up autoloader instance
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Zend_');