In the introduction, we indicated that the front controller also acts as a registry for the various controller components. It does so through a family of "param" methods. These methods allow you to register arbitrary data -- objects and variables -- with the front controller to be retrieved at any time in the dispatch chain. These values are passed on to the router, dispatcher, and action controllers. The methods include:
setParam($name, $value)allows you to set a single parameter of
setParams(array $params)allows you to set multiple parameters at once using an associative array.
getParam($name)allows you to retrieve a single parameter at a time, using
$nameas the identifier.
getParams()allows you to retrieve the entire list of parameters at once.
clearParams()allows you to clear a single parameter (by passing a string identifier), multiple named parameters (by passing an array of string identifiers), or the entire parameter stack (by passing nothing).
There are several pre-defined parameters that may be set that have specific uses in the dispatch chain:
useDefaultControllerAlways is used to hint to the dispatcher to use the default controller in the default module for any request that is not dispatchable (i.e., the module, controller, and/or action do not exist). By default, this is off.
See MVC Exceptions You May Encounter for more detailed information on using this setting.
disableOutputBuffering is used to hint to the dispatcher that it should not use output buffering to capture output generated by action controllers. By default, the dispatcher captures any output and appends it to the response object body content.
noViewRenderer is used to disable the ViewRenderer. Set this parameter to
TRUEto disable it.
noErrorHandler is used to disable the Error Handler plugin. Set this parameter to
TRUEto disable it.