9.2 Controllers: predefined implementations
9.2.1 AbstractController
To extend our AbstractController, you simply have to implement the doHandle() method, with the same signature of ControllerInterface, plus options parameters:
class MyController extend \metadigit\core\web\controller\AbstractController {
function doHandle(Request $Req, Response $Res, $param1, $param2=null) {
// .. do stuff
}
}
9.2.2 ActionController
ActionController is the fundamental brick of every MVC framework, allowing you to easily group your actions in a few number of Controller, without having to … your application with thousand of different controllers.
Basicly, you action controller can define has many actions as you want, each of them having
class MyActionController extends \metadigit\core\web\controller\ActionController {
function exampleAction(Request $Req, Response $Res) {
// .. do stuff
}
function otherAction(Request $Req, Response $Res) {
// .. do stuff
}
}
Updated about 1 month ago