# 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.

- params: array of key to value pairs to register with the front controller.

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.

    [production]
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.moduleControllerDirectoryName = "actions"
    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
    resources.frontController.defaultControllerName = "site"
    resources.frontController.defaultAction = "home"
    resources.frontController.defaultModule = "static"
    resources.frontController.baseUrl = "/subdir"
    resources.frontController.plugins.foo = "My_Plugin_Foo"
    resources.frontController.plugins.bar = "My_Plugin_Bar"
    resources.frontController.env = APPLICATION_ENV

## 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->bootstrap('frontController');
    $front = $bootstrap->frontController;