Module Configuration

A few module behaviors rely on configuration. To modify them, you must create a module.yml file in the module's config/ directory and define settings on a per-environment basis (or under the all: header for all environments). Listing 6-38 shows an example of a module.yml file for the mymodule module.

Listing 6-38 - Module Configuration, in apps/myapp/modules/mymodule/config/module.yml

    all:                 # For all environments
      enabled:     true
      is_internal: false
      view_name:   sfPHP

The enabled parameter allows you to disable all actions of a module. All actions are redirected to the module_disabled_module/module_disabled_action action (as defined in settings.yml).

The is_internal parameter allows you to restrict the execution of all actions of a module to internal calls. For example, this is useful for mail actions that you must be able to call from another action, to send an e-mail message, but not from the outside.

The view_name parameter defines the view class. It must inherit from sfView. Overriding this value allows you to use other view systems, with other templating engines, such as Smarty.

« Anterior índice do Capitulo Seguinte »