mayd.yaml

The mayd.yaml file is the central config file that configures your Mayd bundle for usage with Mayd. The file needs to be in the root of your bundle.

All entries in the file are optional.

Please keep in mind that unknown keys are ignored, so that bundles can be forward compatible. So be sure to check the file for typos.

If the file defines paths, these paths are relative to the bundle directory.

Full example:

routes:
    backend: 'config/routes/backend.yaml'
    frontend:
        path: 'config/routes/frontend.yaml'
    root:
        path: 'config/routes/root.yaml'
        priority: 10

assets:
    packages:
        '@mayd/some-package': '1.0.0'

entries:
    backend:
        js: '@mayd/some-package/js/backend.js'
        scss: '@mayd/some-package/scss/backend.scss'
    frontend:
        js: '@mayd/some-package/js/frontend.js'
        scss: '@mayd/some-package/scss/frontend.scss'

form_theme: 'form/theme.html.twig'

Routing

routes:
    frontend: 'Resources/config/routes/backend.yaml'
    backend: '...'
    root: '...'
parameters
nametypedescription
routes.frontendstringRouting file for frontend paths (with automatic /a/ prefix).
routes.backendstringRouting file for backend paths (with automatic /mayd/ prefix).
routes.rootstringRouting file for paths without prefix. This should only be used in very rare cases.

Defines which file are used to define the different routes. All files are automatically correctly prefixed, so that e.g. the backend files use the correct security restrictions.

By convention, the entry routing files should be named like the key in the mayd.yaml. These files either directly define all entries or import from a directory that is named like themselves (e.g. backend/datasets.yaml).

Each entry in the routes list can either be a string to use priority 0 or set an explicit priority. The entries of all bundles will then be sorted by descending priority.

routes:
    backend:
        root: "root.yaml" # will have default priority 0

routes:
    backend:
        root:
            path: "root.yaml" # will have default priority 0

routes:
    backend:
        root:
            path: "root.yaml"
            priority: 10

Assets

Defines which asset packages are required by the bundle and which entries are provided.

assets:
    packages:
        '@mayd/core': '1.0.3'
parameters
nametypedescription
assets.packageskey/valueThe required NPM packages with their minimum version.
assets.namespaceskey/valueThe namespaces for the AssetsBundle, that are provided by this bundle.

The packages are automatically patched into the projects package.json, if the newly required version is higher than the previously required version.

Entries

This option defines which entry points should automatically be included in the compilation of the project frontend assets.

entries:
    backend:
        js: '@mayd/core'
        scss: '@mayd/core/scss/mayd.scss'

Currently only the keys js and scss are recognized.

Form Theme

Your application / bundle can define a single template, that defines all required custom form widget themes. This file we be loaded if the mayd_form_themes() function is used when developing forms.

form_theme: 'form/theme.html.twig'
parameters
nametypedescription
form_themestringThe path to the template.

The path is relative to the bundle namespace.

Table of Contents