zendframework/zend-mvc
Zend\Mvc is Zend Framework’s MVC layer for building PHP web apps. It provides routing, controllers, dispatching, request/response handling, view integration, and an event-driven pipeline. Designed for modular apps and flexible configuration.
This package is the legacy MVC component from Zend Framework (now Laminas), archived since 2018. In modern workflows, developers would only interact with it when maintaining very old Laminas or Zend Framework applications. Start by confirming your app’s framework version (composer show), then inspect config/application.config.php and module/Application/Module.php. The first use case is typically bootstrapping — the MvcEvent system powers request/response lifecycle, so you’ll interact with it when defining route listeners, error handlers, or action helpers.
Module::onBootstrap(MvcEvent $e) is where you attach global event listeners (e.g., for authentication or logging).redirect(), flashMessenger(), halt() live in Zend\Mvc\Controller\Plugin, accessed via $this->pluginName() in controllers.config/module.config.php under router.routes, using simple or complex chainable route types (e.g., Literal, Segment).controllers.factories in config; the ServiceManager bridges dependencies into controllers via __construct() or invokables.ViewModel and ViewManager coordinate template rendering; plugins like url() or basePath() are available in templates.Laminas\ instead of Zend\) or modern frameworks (Laravel/Symfony) for security and bug fixes.zendframework/zend-mvc) still resolve to Laminas packages — verify composer show -i to confirm installed source.onBootstrap() run on every request; avoid expensive logic or database calls unless absolutely necessary — use short-circuiting via MvcEvent::stopPropagation() where possible.Zend\Mvc\Controller\Plugin\Redirect error logging by adding use Zend\Mvc\Application; and Application::getMvcEvent()->getParam('route-match').MvcEvent::EVENT_DISPATCH for pre/post-controller logic, but avoid overriding core controller classes unless necessary — prefer composition via controller plugins or dependency injection.How can I help you explore Laravel packages today?