I am experimenting with a front controller like Phrame and decided to create one of my own for kicks. Both of them seem to drop my call to a class before it can be called.
Here is the code for the controller; a simple case that takes the action variable from the request and calls up a class, instantiates the object and calls the perform method. The problem is that the object never gets instantiated because PHP drops the call before the class. I can't figure out why this is happening. here is some code:
case 'login':
require_once('classes/login/LoginAction.php');
$action = new LoginAction();
$action->process();
break;
The previous statement is called with the following url: http:localhost/controller.php?action=login
And here is the class:
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/classes/Action.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/classes/Smarty/Smarty.class.php');
echo 'I can see this';
class LoginAction extends Action
{
function perform() {
echo'I cannot see this';
/*$smarty = new Smarty();
$smarty->display('default.tpl.html');*/
}
}
?>
Any ideas why the $action object never gets instantiated (ie. the class doesn't get called)?