zend-mvc-console exists to enable legacy console tooling for zend-mvc applications. As such, one of its primary functions is providing services to the MVC layer.
This chapter details the various services registered by zend-mvc-console by default, the classes they represent, and any configuration options available.
The following is a list of service names and what the service returns.
|Service Name||Creates instance of|
The following is a list of service aliases.
When operating in a console environment, several typical zend-mvc services need to operate differently, or require alternate services. To enable that, zend-mvc-console provides a number of delegator factories. The following is a list of those provided, the service they override, and a description of what they do.
|Service Name||Delegator Factory||Description|
||In a console environment, attaches the
||Attaches an initializer for injecting
||If a console environment is detected, replaces the request with a
||If a console environment is detected, replaces the response with a
||If a console environment is detected, replaces the router with the
||If a console environment is detected, attaches the
||If a console environment is detected, injects override factories for the
Application Configuration Options
Console tooling provides several locations for configuration, primarily at the service, routing, and view levels.
All services registered can be configured to use different factories; see the above tables for details on what service names to override.
Routing configuration is detailed in the routing chapter.
Zend\Mvc\Console\View\ViewManager acts similarly to its zend-mvc
will look for one or the other of the following configuration structures:
return [ 'view_manager' => [ 'mvc_strategies' => $stringOrArrayOfMvcListenerServiceNames, 'strategies' => $stringOrArrayOfViewListenerServiceNames, ], 'console' => [ 'view_manager' => [ 'mvc_strategies' => $stringOrArrayOfMvcListenerServiceNames, 'strategies' => $stringOrArrayOfViewListenerServiceNames, ], ], ];
Preference is given to those under the
console top-level key (those under
view_manager are ignored if the
console.view_manager structure exists).
mvc_strategies refers to view-related listeners that need to operate on the
strategies refers to view-related listeners that operate