anthonator
Views/Templates without Phoenix
I’m sure this has been asked a thousand times but I’m having trouble finding anything.
We currently have a project that doesn’t use Phoenix but does need template/view support. I haven’t found any standalone libraries that provide this functionality but figured I may just not be using the right keywords. I’ve looked through Phoenix’s implementation of templates and views and it seems relatively straight forward. If nothing exists and this is something the community is interested in I could implement something and open source it myself.
Thanks in advance!
Most Liked
LostKobrakai
I’m wondering what part of Phoenix do you actually need over plain EEx?
bryanjos
As @LostKobrakai said, EEx comes with Elixir itself. If that gives you what you want
anthonator
Here’s what I’ve come up with for now.
defmodule MyApp.Views.PasswordReset do
require EEx
@root "lib/myapp/templates/password_reset"
EEx.function_from_file(:def, :request, Path.join(@root, "request.html.eex"), [:assigns])
end







