View Source PhoenixAnalytics.Web.Router (PhoenixAnalytics v0.3.2)
PhoenixAnalytics.Web.Router
This module provides routing functionality for the Phoenix Analytics dashboard.
It defines a macro phoenix_analytics_dashboard
that sets up the necessary routes
for the analytics dashboard, and a helper function parse_options
to process
the options passed to the macro.
Macro: phoenix_analytics_dashboard/2
Creates routes for the Phoenix Analytics dashboard.
Parameters:
- path: The base path for the dashboard routes.
- opts: Optional keyword list of configuration options.
Options:
- :as - The name for the live session (default: :phoenix_analytics_dashboard)
- :on_mount - Additional mount hooks to be executed (default: [])
Usage:
phoenix_analytics_dashboard "/analytics"
Function: parse_options/2
Processes the options passed to the phoenix_analytics_dashboard
macro.
Parameters:
- opts: The options keyword list.
- path: The base path for the dashboard.
Returns:
A tuple containing the session name and session options.
This function sets up the default on_mount hooks, including a custom hook to set the dashboard path, and allows for additional custom hooks to be added. It also configures the root layout for the dashboard.