Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

7.x 2.x config

Andy Truong edited this page Feb 14, 2014 · 2 revisions

Config — [7.x 2.x]

Simple API to read config values from YAML files.

If you have a yaml file like this (atest_config depends on at_base)

# at_base/tests/atest_config/config/config.yml
foo: bar

You can read foo value with this code:

echo at_config('atest_config')->get('foo'); // bar

Yaml file can import data from other files:

imports:
  - { resource: to_be_imported.yml }
foo: bar

Shortcuts

Get all services definitions of all modules which implements it

<?php
at_container('helper.config_fetcher')
  ->getItems('at_base', 'services', 'services', $include_base = TRUE)
;

Get specific service definition

<?php
at_container('helper.config_fetcher')
  ->getItem('at_base', 'services', 'services', 'twig', $include_base = TRUE)
;

Clone this wiki locally