.. Mvc/Application.php generated using docpx on 01/30/13 03:27pm Class ***** Zend\\Mvc\\Application ====================== Main application class for invoking applications Expects the user will provide a configured ServiceManager, configured with the following services: - EventManager - ModuleManager - Request - Response - RouteListener - Router - DispatchListener - ViewManager The most common workflow is: $services = new Zend\ServiceManager\ServiceManager($servicesConfig); $app = new Application($appConfig, $services); $app->bootstrap(); $response = $app->run(); $response->send(); bootstrap() opts in to the default route, dispatch, and view listeners, sets up the MvcEvent, and triggers the bootstrap event. This can be omitted if you wish to setup your own listeners and/or workflow; alternately, you can simply extend the class to override such behavior. Methods ------- __construct +++++++++++ .. function:: __construct() Constructor :param mixed: :param ServiceManager: getConfig +++++++++ .. function:: getConfig() Retrieve the application configuration :rtype: array|object bootstrap +++++++++ .. function:: bootstrap() Bootstrap the application Defines and binds the MvcEvent, and passes it the request, response, and router. Attaches the ViewManager as a listener. Triggers the bootstrap event. :rtype: Application getServiceManager +++++++++++++++++ .. function:: getServiceManager() Retrieve the service manager :rtype: ServiceManager getRequest ++++++++++ .. function:: getRequest() Get the request object :rtype: \Zend\Stdlib\RequestInterface getResponse +++++++++++ .. function:: getResponse() Get the response object :rtype: ResponseInterface getMvcEvent +++++++++++ .. function:: getMvcEvent() Get the MVC event instance :rtype: MvcEvent setEventManager +++++++++++++++ .. function:: setEventManager() Set the event manager instance :param EventManagerInterface: :rtype: Application getEventManager +++++++++++++++ .. function:: getEventManager() Retrieve the event manager Lazy-loads an EventManager instance if none registered. :rtype: EventManagerInterface init ++++ .. function:: init() Static method for quick and easy initialization of the Application. If you use this init() method, you cannot specify a service with the name of 'ApplicationConfig' in your service manager config. This name is reserved to hold the array from application.config.php. The following services can only be overridden from application.config.php: - ModuleManager - SharedEventManager - EventManager & Zend\EventManager\EventManagerInterface All other services are configured after module loading, thus can be overridden by modules. :param array: :rtype: Application run +++ .. function:: run() Run the application :rtype: ResponseInterface send ++++ .. function:: send() @deprecated completeRequest +++++++++++++++ .. function:: completeRequest() Complete the request Triggers "render" and "finish" events, and returns response from event object. :param MvcEvent: :rtype: ResponseInterface Constants --------- ERROR_CONTROLLER_CANNOT_DISPATCH ++++++++++++++++++++++++++++++++ ERROR_CONTROLLER_NOT_FOUND ++++++++++++++++++++++++++ ERROR_CONTROLLER_INVALID ++++++++++++++++++++++++ ERROR_EXCEPTION +++++++++++++++ ERROR_ROUTER_NO_MATCH +++++++++++++++++++++