Configuration

config.yaml

For a working setup, you need a config/config.yaml.

Following fields can be set in basic kernel configuration:

config-local.yaml

config-local.yaml is meant for local modifications to config.yaml. Everything you put in config-local.yaml will override that specific setting in config.yaml.

Example:

config.yaml

setup:
    debug: false
    lang: en

config-local.yaml

setup:
    debug: true

Resulting configuration:

setup:
    debug: true
    lang: en

Example configuration

config.yaml

# as default production is assumed, so no debug which defaults to false
setup:
  lang: fi

# define autoloader class files here
modules:
  # core
  AbstractModule: 'Core/AbstractModule'
  Exceptions: 'Core/Exceptions'
  Controller: 'Core/Controller'
  Validate: 'Core/Validate'
  Compose: 'Core/Compose'
  # authentication and account handling
  Session:
    class: 'Core/Session'
    authenticators:
      - UserDefault
  AbstractUser: 'Auth/AbstractUser'
  AbstractRoles: 'Auth/AbstractRoles'
  UserDefault: 'Auth/Default/UserDefault'
  RolesDefault: 'Auth/Default/RolesDefault'
  # for project
  MyClass:
    class: 'MyModule/MyClass'
    # accesible from module using $this->getModuleValue('settings')
    settings:
      # accesible from module using $this->getModuleValue('settings', 'my_setting1')
      my_setting1: true
      my_setting2:
        my_array_setting1: 'yes and no'
        my_array_setting2: null

# twig setup
twig:
  debug: false
  cache: false

# basic site js/css includes
javascript:
  - common:*
  - bootstrap:*
  - auth:*
  - admin:*
  - site.js # includes web/js/site.js
css:
  - common:*
  - bootstrap:*
  - auth:*
  - admin:*
  - site.css # includes web/css/site.js

config-local.yaml

# override debug from your local configuration
setup:
  debug: true
# setup database settings ALWAYS locally
doctrine:
  driver: pdo_mysql
  host: sql.server
  port: 3306
  dbname: database
  user: name
  password: pass