drab v0.4.1 Drab.Config

Drab configuration related functions.

Summary

Functions

Returns all environment for the default main Application

Returns the name of the client Phoenix Application

Depreciated. Use get/1 instead

Returns the Endpoint of the client Phoenix Application

Returns Drab configuration for the given atom

Functions

app_env()

Returns all environment for the default main Application

app_name()

Returns the name of the client Phoenix Application

config()

Depreciated. Use get/1 instead.

endpoint()

Returns the Endpoint of the client Phoenix Application

get(arg1)

Returns Drab configuration for the given atom.

iex> Drab.Config.get(:templates_path)
"priv/templates/drab"

All the config values may be override in config.exs, for example:

config :drab, disable_controls_while_processing: false

Configuration options:

  • templates_path (default: “priv/templates/drab”) - path to the user templates (may be new or override default templates)
  • disable_controls_while_processing (default: true) - after sending request to the server, sender will be disabled until get the answer; warning: this behaviour is not broadcasted, so only the control in the current browers will be disabled
  • events_to_disable_while_processing (default: ["click"]) - list of events which will be disabled when waiting for server response
  • disable_controls_when_disconnected (default: true) - disables control when there is no connectivity between the browser and the server
  • socket (default: "/socket") - path to the socket where Drab operates
  • drab_store_storage (default: :session_storage) - where to keep the Drab Store - :memory, :local_storage or :session_storage; data in memory is kept to the next page load, session storage persist until browser (or a tab) is closed, and local storage is kept forever
  • browser_response_timeout - timeout, after which all functions querying/updating browser UI will give up; integer in milliseconds or :infinity