EEx.Engine behaviour
This is the basic EEx engine that ships with Elixir. An engine needs to implement two functions:
handle_text(buffer, text)- it receives the buffer, the text and must return a new quoted expression;handle_expr(buffer, marker, expr)- it receives the buffer, the marker, the expr and must return a new quoted expression;The marker is what follows exactly after
<%. For example,<% foo %>has an empty marker, but<%= foo %>has'='as marker. The allowed markers so far are:'''='
Read
handle_expr/3below for more information about the markers implemented by default by this engine.
Summary
| handle_expr(buffer, binary2, expr) | Implements expressions according to the markers |
| handle_text(buffer, text) | The default implementation simply concatenates text to the buffer |
Functions
Implements expressions according to the markers.
<% Elixir expression - inline with output %>
<%= Elixir expression - replace with result %>
All other markers are not implemented by this engine.