drab v0.6.3 Drab.Config
Drab configuration related functions.
Link to this section Summary
Functions
Returns the config for current main Application
Returns any config key for current main Application
Returns all environment for the default main Application
Returns the Phoenix Application module atom
Returns the name of the client Phoenix Application
Returns configured Drab.Live.Engine Extension. String with dot at the begin
Returns the Endpoint of the client Phoenix Application
Returns Drab configuration for the given atom
Returns the PubSub module of the client Phoenix Application
Link to this section Functions
Returns the config for current main Application
iex> is_list(Drab.Config.app_config())
true
Returns any config key for current main Application
iex> Drab.app_config(:secret_key_base)
"bP1ZF+DDZiAVGuIixHSboET1g18BPO4HeZnggJA/7q"
Returns all environment for the default main Application
iex> is_list(Drab.Config.app_config())
true
Returns the Phoenix Application module atom
iex> Drab.Config.app_module()
DrabTestApp
Returns the name of the client Phoenix Application
iex> Drab.Config.app_name()
:drab
Returns configured Drab.Live.Engine Extension. String with dot at the begin.
Example, for config:
config :phoenix, :template_engines,
drab: Drab.Live.Engine
it will return “.drab”
iex> Drab.Config.drab_extension()
".drab"
Returns the Endpoint of the client Phoenix Application
iex> Drab.Config.endpoint()
DrabTestApp.Endpoint
Returns Drab configuration for the given atom.
iex> Drab.Config.get(:templates_path)
"test/support/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 disabledevents_to_disable_while_processing
(default:["click"]
) - list of events which will be disabled when waiting for server responsedisable_controls_when_disconnected
(default:true
) - disables control when there is no connectivity between the browser and the serversocket
(default:"/socket"
) - path to the socket where Drab operatesdrab_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 foreverbrowser_response_timeout
- timeout, after which all functions querying/updating browser UI will give up; integer in milliseconds or:infinity
main_phoenix_app
- a name of your Phoenix application (atom); if not set it gets it from themix.exs
enable_live_scripts
- true for re-evaluate javascripts contain living assignslive_helper_modules
- a list of modules to be imported when Drab.Live evaluates expression with living assign; default is[Router.Helpers, ErrorHelpers, Gettext]
Returns the PubSub module of the client Phoenix Application
iex> Drab.Config.pubsub()
DrabTestApp.PubSub