API Reference Routex v1.2.2

View Source

Modules

Routex enhances the Phoenix Router by providing an extension-driven framework for advanced routing capabilities. It simplifies route manipulation, offering features such as internationalization (i18n), localization (l10n), translated (multilingual) URLs, and alternative route generation.

Provides an interface to access and update Routex attributes in routes, sockets, or connections (hereinafter containers).

use Routex.Backend

When used, this module generates a Routex backend module and a configuration struct by running the configure/2 callbacks of the extensions provided in opts.

Provides a function to build branched variants of macro's

Provides functions to aid during development

Specification for composable Routex extensions.

Creates helper functions to get a list of maps alternative slugs and their Routex.Attrs by providing a binary url. Sets match?: true for the url matching record.

Creates alternative routes based on branches configured in a Routex backend module. Branches can be nested and each branch can provide Routex.Attrs to be shared with other extensions.

Struct for flattened branch

Struct for branch with optionally nested branches

Module to create and validate a Config struct

Raised when the custom attributes of branches do not have the same keys.

Raised when the branch map does not start with the root branch "/".

Extracts Routex.Attrs from a route and makes them available in components and controllers with the assigns operator @ (optionally under a namespace).

Access route attributes at runtime within your controllers, plugs, or LiveViews based on the matched route's properties. Uses pattern matching for optimal performance during runtime.

Adapter for projects using :ex_cldr. It generates configuration for locale routes based on your existing Cldr setup for a seamless experience.

Transforms routes to be unrecognizable.

A route may be defined with a routes Routex.Attrs interpolated into it. These interpolations are specified using the usual #{variable} interpolation syntax. Unlike some other routing solutions, interpolation is not restricted to the beginning of routes.

Raised when a list of routes contains routes with the same path and verb.

Attach LiveView hooks provided by Routex extensions.

Handles parsing of locale strings. Uses efficient binary pattern matching and follows RFC 5646 BCP 47 language tag format.

Localize your Phoenix with minimal configuration.

Main module for locale detection logic.

Extracts locale information from various sources. Handles both Plug.Conn structs and map inputs.

Handles parsing of accept-language headers. Uses efficient binary pattern matching and follows RFC 5646 BCP 47 language tag format.

Localize Phoenix routes using simple configuration.

Pre-generated locale registry shipped with Routex. Generated from IANA Language Subtag Registry.

Type definitions for locale detection.

Provides integration for plugs defined by Routex extensions.

This module provides route helpers that support the automatic selection of alternative routes. These helpers can serve as drop-in replacements for Phoenix's default route helpers.

The Routex.Extension.RuntimeDispatcher enables the dynamic dispatching of functions to external libraries or modules during the Plug pipeline and LiveView's handle_params. This dispatching is configured using a list of {module, function, arguments} tuples and leverages attributes from Routex.Attrs at runtime.

Enables users to enter URLs using localized terms which can enhance user engagement and content relevance.

Supports the use of original route paths in controllers and templates while rendering transformed route paths at runtime without performance impact.

Provides fallback functions when use'd

Matchables are an essential part of Routex. They are used to match run time routes with compile time routes and enable reordered route segments.

This module provides everything needed to process Phoenix routes. It executes the transform callbacks from extensions to transform Phoenix.Router.Route structs and create_helpers callbacks to create one unified Helper module.

Function for working with Routex augmented Phoenix Routes

Provides macro (callbacks) to alter route definition before compilation.

Types shared by Routex core and extensions.

Provides an interface to functions which can be used in extensions.