drab v0.10.5 API Reference
Modules
Drab allows to query and manipulate the User Interface directly from the Phoenix server backend
Browser related functions
Enable Drab on the browser side. Must be included in HTML template, for example
in web/templates/layout/app.html.eex
Provides various encoders/decoders to store values in the string
Drab Commander is a module to keep event handler functions
Drab configuration
Set up Drab options for pages generated by the controller
Drab module providing the base of communication between the browser and the server
HTML element query and manipulation library
Drab Module to provide a live access and update of assigns of the template, which is currently rendered and displayed in the browser
This is an implementation of EEx.Engine that injects Drab.Live
behaviour
Drab Template Engine, uses Drab.Live.EExEngine
to compile templates
Drab Module to launch Bootstrap Modal in the browser
Conveniences for Phoenix.Presence
Drab operates on websockets. To enable it, you need to tell your application’s socket module to
use Drab. For this, you will need to modify the socket module (by default it is UserSocket
in web/channels/user_socket.ex
)
Enables Drab Waiter functionality - synchronous wait for browser events in the Commander handler function
Module with named helpers generated from DrabTestApp.Router
Exceptions
Raised when misconfigured, for example trying to call not declared handler
Raised when function tries to query disconnected page
Raised when the browser encounters a JS error or the timeout for the current operation
Mix Tasks
Generates a Drab commander
Installs Drab in the current Phoenix application. It does inject lines of code to the existing .ex, .exs and *.eex files, so it is wise to commit before continuing