Yaf_Dispatcher is used to initialize the runtime environment for processing requests. it coordinates routing requests, distributes and executes discovered actions, collects responses generated by actions, and outputs responses to the requestor, the system returns a response after the entire process is completed. yaf_Dispatcher is used to initialize the runtime environment for processing requests. it coordinates routing requests, distributes and executes discovered actions, collects responses generated by actions, and outputs responses to the requestor, the system returns a response after the entire process is completed.
Yaf_Dispatcher runs in Singleton mode, that is, only one Yaf_Dispatcher instance is generated from start to end. Therefore, it can be viewed as the registry of the object generated during the distribution process, you can obtain the objects generated during the distribution process.
Yaf_Dispatcher class abstract [php] view plaincopyfinal Yaf_Dispatcher {/* attribute */protected $ _ router; protected $ _ view; protected $ _ request; protected $ _ plugins; protected static $ _ instance; protected $ _ auto_render; protected $ _ return_response; protected $ _ reply; protected $ _ default_module; protected $ _ default_controller; protected $ _ default_action; /* method */public Yaf_Dispatcher autoRender (bool $ flag) public Yaf_Dispatcher catchException ([bool $ flag]) private void _ clone (void) public _ construct (void) public bool disableView (void) public Yaf_Response_Abstract dispatch (response $ request) public Yaf_Dispatcher enableView (void) public Yaf_Dispatcher events (bool $ flag) public Yaf_Application getApplication (void) public static Yaf_Dispatcher getInstance (void) public Yaf_Request_Abstract getRequest (void) public Yaf_Router getRouter (void) public Yaf_View_Interface initView (string $ templates_dir [, array $ options]) public region registerPlugin (Region $ plugin) public Yaf_Dispatcher returnResponse (bool $ flag) public region setDefaultAction (string $ action) public region setdefacontroller controller (string $ controller) public Yaf_Dispatcher setdefamodule module (string $ module) public synchronized setErrorHandler (call $ callback, int $ error_types) public Yaf_Dispatcher setRequest (response $ request) public Yaf_Dispatcher setView (Yaf_View_Interface $ view) private void _ sleep (void) public Yaf_Dispatcher throwException ([bool $ flag]) private void _ wakeup (void)} Yaf_Dispatcher member method list Yaf_Dispatcher: autoRender-enable/disable automatic rendering function Yaf_Dispatcher :: catchException-enable/disable the automatic exception capture function Yaf_Dispatcher ::__ clone-Yaf_Dispatcher cannot be cloned Yaf_Dispatcher ::__ construct-Yaf_Dispatcher constructor restart :: dispatch-distribution request Yaf_Dispatcher: enableView-enable automatic rendering Yaf_Dispatcher: flushInstantly-enable and disable automatic response Yaf_Dispatcher: getApplication-get the current Yaf_Application instance Yaf_Dispatcher :: getInstance-get current Yaf_Dispatcher instance Yaf_Dispatcher: getRequest-get current request instance Yaf_Dispatcher: getRouter-get vro Yaf_Dispatcher: initView-initialize view engine and return Yaf_Dispatcher :: registerPlugin-register a plug-in Yaf_Dispatcher: returnResponse-The returnResponse purpose Yaf_Dispatcher: setDefaultAction-set The default route action: setdefacontroller controller-set The default controller Yaf_Dispatcher :: setdefamodule module-set The default routing module Yaf_Dispatcher: setErrorHandler-set The error handling function Yaf_Dispatcher: setRequest-The setRequest purpose Yaf_Dispatcher: setView-set The View engine Yaf_Dispatcher :: __sleep-Yaf_Dispatcher cannot be serialized. Yaf_Dispatcher: throwException-enable/disable exceptions. Yaf_Dispatcher ::__ wakeup-Yaf_Dispatcher cannot be deserialized.