Skip to content

Instantly share code, notes, and snippets.

@and1truong
Created October 15, 2012 14:45
Show Gist options
  • Select an option

  • Save and1truong/3892862 to your computer and use it in GitHub Desktop.

Select an option

Save and1truong/3892862 to your computer and use it in GitHub Desktop.
A Simple configuration system

Example configuration file in yaml format:

# module_name.yaml
foo: bar
baz: [foo, bar]

Example Code:

<?php
// return bar
vc_conf('module_name.foo')->get();

// override configuration value
vc_conf('module_name.foo')->set('baz');

// Restore default configuration value.
vc_conf('module_name._name')->restore();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment