View Source ZoonkWeb (Zoonk v0.2.0-alpha)

The entrypoint for defining our web interface, such as controllers, components, channels, and so on.

This can be used as:

use ZoonkWeb, :controller
use ZoonkWeb, :html

The definitions below will be executed for every controller, component, etc, so keep them short and clean, focused on imports, uses and aliases.

Do NOT define functions inside the quoted expressions below. Instead, define additional modules and import those modules here.

Link to this section Summary

Functions

When used, dispatch to the appropriate controller/view/etc.

Define a channel module.

Define a controller module.

Define an html module.

Define a live_component module.

Define a live_view module.

Define a router module.

List of paths that can be used to render static assets.

Define a verified_routes module.

Link to this section Functions

Link to this macro

__using__(which)

View Source (macro)

When used, dispatch to the appropriate controller/view/etc.

Define a channel module.

examples

Examples

defmodule ZoonkWeb.UserSocket do
  use ZoonkWeb, :channel
  ...
end

Define a controller module.

It uses the Phoenix.Controller module.

examples

Examples

defmodule ZoonkWeb.PageController do
  use ZoonkWeb, :controller
  ...
end

Define an html module.

It uses the Phoenix.Component module.

examples

Examples

defmodule ZoonkWeb.PageView do
  use ZoonkWeb, :html
  ...
end

Define a live_component module.

It uses the Phoenix.LiveComponent module.

examples

Examples

defmodule ZoonkWeb.Components.Modal do
  use ZoonkWeb, :live_component
  ...
end

Define a live_view module.

It uses the Phoenix.LiveView module.

examples

Examples

defmodule ZoonkWeb.PageLive do
  use ZoonkWeb, :live_view
  ...
end

Define a router module.

It uses the Phoenix.Router module.

examples

Examples

defmodule ZoonkWeb.Router do
  use ZoonkWeb, :router
  ...
end

List of paths that can be used to render static assets.

Files in these paths can be accessed using verified routes: ~p"/images/logo.png".

Define a verified_routes module.

It uses the Phoenix.VerifiedRoutes module.

examples

Examples

defmodule ZoonkWeb.Plugs.UserAuth do
  use ZoonkWeb, :verified_routes
  ...
end