Zend_Application_Resource_Frontcontroller
Probably the most common resource you will load with
Zend_Application will be the Front Controller resource,
which provides the ability to configure
Zend_Controller_Front. This resource provides the ability
to set arbitrary front controller parameters, specify plugins to
initialize, and much more.
Once initialized, the resource assigns the $frontController
property of the bootstrap to the Zend_Controller_Front
instance.
Available configuration keys include the following, and are case
insensitive:
controllerDirectory: either a string value
specifying a single controller directory, or an array of
module to controller directory pairs.
moduleControllerDirectoryName: a string
value indicating the subdirectory under a module that contains controllers.
moduleDirectory: directory under which
modules may be found.
defaultControllerName: base name of the
default controller (normally "index").
defaultAction: base name of the default
action (normally "index").
defaultModule: base name of the default
module (normally "default").
baseUrl: explicit base
URL to the application (normally auto-detected).
plugins: array of front controller plugin
class names. The resource will instantiate each class (with no constructor
arguments) and then register the instance with the front controller. If you want to
register a plugin with a particular stack index, you need to provide an array with
two keys class and stackIndex.
params: array of key to value pairs to
register with the front controller.
returnresponse: whether or not to return
the response object after dispatching the front controller. Value should be a
boolean; by default, this is disabled.
dispatcher: allows overriding the default
dispatcher. Has two subkeys, class (the classname of new dispatcher)
and params, an array of parameters to pass to the dispatcher constructor.
Overriding the dispatcher
If an unrecognized key is provided, it is registered as a front
controller parameter by passing it to setParam().
Sample Front Controller resource configuration
Below is a sample INI snippet showing how to configure the front
controller resource.
Retrieving the Front Controller in your bootstrap
Once your Front Controller resource has been initialized, you can
fetch the Front Controller instance via the
$frontController property of your bootstrap.
bootstrap('frontController');
$front = $bootstrap->frontController;
]]>