The concept of front controller no longer exists in ZF2. In this new version of the framework, any class that implements DispatchableInterface
can be a MVC controller.
interface DispatchableInterface { public function dispatch(Request $request, Response $response = null); }
As you can see, this interface only defines one method: dispatch. You can create a controller following this approach, but you will need to define this method and the logic in every controller or in a parent controller. In such cases, it's much better to use the already coded AbstractActionController
that provided this method and the logic required to dispatch a request.
The MVC layer of ZF2 provides a few more interfaces that you can implement to provide the controllers with even more functionality. Let's take a look at the common interfaces that can be used with controllers.