KinoPhoenixLiveView.DynamicRootLayout (kino_phoenix_live_view v0.1.2)

A plug that dynamically sets the root layout for Phoenix controllers.

It retrieves the root layout module from the application environment (defaulting to KinoPhoenixLiveView.Layout) and assigns it to the connection.

Summary

Functions

Sets the root layout for the connection dynamically.

Initializes the plug options.

Functions

call(conn, opts)

Sets the root layout for the connection dynamically.

It fetches the layout from the application configuration and updates the connection using Phoenix.Controller.put_root_layout/2.

Parameters

  • conn: The connection struct.
  • _opts: Unused options.

Returns

  • The updated connection.

init(opts)

Initializes the plug options.

This plug does not require any special options.

Parameters

  • opts: The plug options.

Returns

  • The unchanged options.