view!() { /* proc-macro */ }Expand description
#[derive(FormRequest)], view!, error_view!, and #[derive(Model)] -
re-exported here so generated apps depend only on larust-support, not
on larust-macros directly. All four macros’ generated code assumes
this re-export path (::larust_support::...).
view!("posts.index", { posts }): reads, parses, and resolves
resources/views/posts/index.blade.xr (including any @extends layout
chain) at compile time, and generates code that renders it into a
View. Interpolated expressions ({{ user.name }}) and directive
conditions/iterables (@if(...), @foreach(...)) are parsed as real
Rust expressions and spliced directly into the generated function body -
an undeclared variable is a genuine rustc compile error, not a
custom check.
ⓘ
view!("posts.index", { posts })