Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Latest commit

 

History

History
27 lines (18 loc) · 827 Bytes

helpers.md

File metadata and controls

27 lines (18 loc) · 827 Bytes

Varie has a few helpers that can help speed up your development.

app method

The app function returns the service container instance:

let container = app;

Which you may use a contract name to resolve the service from the container:

$api = app.make("$documentationService");

[{.alert} While this is possible, you should use dependency injection where possible.]

$config method

The config function gets the value of a configuration variable. The configuration values may be accessed using "dot" syntax, which includes the name of the file and the option you wish to access. A default value may be specified and is returned if the configuration option does not exist:

$config.get("env.ENV", "development");