3 ms·
> What do you mean by this? In the new 1.7 approach to views, you explicitly set the path For example, if you wrote a liveview called FooView in /path/to/my_li
by throwawaymaths 3y ago
> What do you mean by this? In the new 1.7 approach to views, you explicitly set the path
For example, if you wrote a liveview called FooView in /path/to/my_liveview, a default render() will look for /path/to/my_liveview/foo_view.html.heex
(Also note auto-snakecasing)
Btw, this is still a different semantic if you do the deadview equivalent, which will try to do a path resolution in /templates.
I guess these are minor complaints but I would much prefer they use the same default strategy and, say, pass the path in `use Phoenix.Liveview`
- arrowsmith 3y ago> This is still a different semantic if you do the deadview equivalent, which will try to do a path resolution in /templates. Not true in 1.7 - views* don't have any kind of "default" template resolution; you have to explicitly state the template path with `embed_templates`. That is if you're not just defining your HEEx directly within the view module itself, as I already mentioned. *By "views" I mean the new style that uses `use MyAppWeb, :html`, not the old style you describe which is now (in 1.7+) only available as the external dependency `phoenix_view`. The new style of module is still called a "view" by the docs: https://hexdocs.pm/phoenix/request_lifecycle.html#from-endpoint-to-views https://hexdocs.pm/phoenix/request_lifecycle.html#from-endpo...