jeffturcotte/moor — Issue #19: Help with Uncaught exception 'MoorContinueException'
Author: cosenary
Created: 2011-11-03 13:11:09+00:00
State: open

My test code:

require_once '../libraries/moor/Moor.php';

class Test extends MoorAbstractController {
public function helloWorld() {
echo 'Hello World!';
}
}

Moor::route('/hello', 'Test::helloWorld');
Moor::run();

If I call now my /hello route, I always get the following error message:

Fatal error: Uncaught exception 'MoorContinueException' in /var/www/libraries/moor/Moor.php:674
Stack trace:
#0 /var/www/libraries/moor/Moor.php(1319): Moor::triggerContinue()
#1 /var/www/libraries/moor/Moor.php(840): Moor::validateMethodCallback('Moor::routeNotF...')
#2 /var/www/libraries/moor/Moor.php(628): Moor::dispatchRoute(Object(stdClass))
#3 /var/www/public/routes.php(32): Moor::run()
#4 {main}
thrown in /var/www/libraries/moor/Moor.php on line 674

If I add Moor::setNotFoundCallback('Test::notFound'); and a notFound() method to my class:

require_once '../libraries/moor/Moor.php';

class Test extends MoorAbstractController {
public function helloWorld() {
echo 'Hello World!';
}
public function notFound() {
echo 'Not Found!';
}
}

Moor::setNotFoundCallback('Test::notFound');
Moor::route('/hello', 'Test::helloWorld');

Moor::run();

and try to get /hello I always get the Not Found! message.

What I'm doing wrong? Can you give me some advice which helps me to solve the problem?
Many thanks in advance,
Christian