Documentation

Plugins/Claypool/env

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Plugins/Claypool

env( name, [env] )

Sets, extends, or retrieves properties from the environment.
The environment is a collection of name/value pairs that can easy be switched before the application is booted to allow easy change between test, development, and production environments. You can have as many environments as you want.
Arguments:
nameString
If only one arg is present, the plugin method is treated as a getter and the value of the name is returned
env (Optional)String
When two arguments are present, the first is treated as the name of the default environment, and the latter is the name of overriding environment.


Examples:
Sets the environment to 'defaults' and extends it with the values in 'client.dev'. See environments.js

$.env('defaults', 'client.dev');

Returns the set environments value of 'serviceURL'

$.env('serviceURL');

NameType