They are designed to handle the view and model/events for a particular page...
Reading some articles on page control, it seems many (including MSDN and other famous places) suggest that this pattern is only good for static linked websites...as updating the navigation, etc would become a burden...
They way I see it...why not use a template engine like Smarty...that way navigation is consistent across the board...
So I ask...in your opinion
A page controller, is responsible for handling events, working with the model and view for one physical web page (according to Fowler)
So the page controller would intereact with view controllers and model controller??? Page controller decides which gets invoked where as the atomic controller for view or model carry out the specific task at hand???
Code: Select all
class Page_Controller{
function invoke()
{
switch($_GET){
case 'update_user':
Model_Controller::updateUser();
break;
}
}
}
class Model_Controller{
function updateUser()
{
$fname = $_POST['first_name'];
$fname = _secure($fname);
$ado->Execute('INSERT INTO table SET fname = "'.$fname.'"');
}
}updateUser() for instance, would be an atomic controller as it's directly manipulating the model and therefore is bound to the model.
Would you agree, that this is a Page Controller???
One could almost argue...a page controller is *sort* of like a mini front controller
Cheers