47
lib/eventos_web/coherence_web.ex
Normal file
47
lib/eventos_web/coherence_web.ex
Normal file
@@ -0,0 +1,47 @@
|
||||
defmodule EventosWeb.Coherence do
|
||||
@moduledoc false
|
||||
|
||||
def view do
|
||||
quote do
|
||||
use Phoenix.View, root: "lib/eventos_web/templates"
|
||||
# Import convenience functions from controllers
|
||||
|
||||
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
|
||||
|
||||
# Use all HTML functionality (forms, tags, etc)
|
||||
use Phoenix.HTML
|
||||
|
||||
import EventosWeb.Router.Helpers
|
||||
import EventosWeb.ErrorHelpers
|
||||
import EventosWeb.Gettext
|
||||
import EventosWeb.Coherence.ViewHelpers
|
||||
end
|
||||
end
|
||||
|
||||
def controller do
|
||||
quote do
|
||||
use Phoenix.Controller, except: [layout_view: 2]
|
||||
use Coherence.Config
|
||||
use Timex
|
||||
|
||||
import Ecto
|
||||
import Ecto.Query
|
||||
import Plug.Conn
|
||||
import EventosWeb.Router.Helpers
|
||||
import EventosWeb.Gettext
|
||||
import Coherence.ControllerHelpers
|
||||
|
||||
alias Coherence.Config
|
||||
alias Coherence.ControllerHelpers, as: Helpers
|
||||
|
||||
require Redirects
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
When used, dispatch to the appropriate controller/view/etc.
|
||||
"""
|
||||
defmacro __using__(which) when is_atom(which) do
|
||||
apply(__MODULE__, which, [])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user