View Source Routex.Backend (Phoenix Routes Extension Framework v0.3.0-alpha.4)
use Routex.Backend
When use'd this module generates a Routex backend module and a configuration struct using the
configure/2
callbacks of the extensions provided inopts
.See also: Routex Extensions.
Example
iex> defmodule MyApp.RtxBackend do
...> use Routex.Backend,
...> extensions: [
...> Routex.Extension.VerifiedRoutes,
...> Routex.Extension.AttrGetters,
...> ],
...> extension_x_config: [key: "value"]
...> end
iex> IO.inspect(%MyApp.RtxBackend{})
%MyApp.RtxBackend{
extension_x_config: [key: "value"],
extensions: [Routex.Extension.VerifiedRoutes, Routex.Extension.AttrGetters],
verified_sigil_routex: "~l",
verified_sigil_original: "~o"
}
Values in the configuration can be overridden by providing an override map to the :private
option of a scope or route.
Example
live /products, MyApp.Web.ProductIndexLive, :index, private: %{rtx: %{overridden_key: value}}
Summary
Types
@type t() :: module()
A Routex backend module