pub struct Html {
pub list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Nodes>>>>,
}Expand description
Html template marker
Values
list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Nodes>>>>- List of templates.
Fields§
§list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Nodes>>>>Implementations§
source§impl Html
impl Html
sourcepub fn new(root: &str) -> Html
pub fn new(root: &str) -> Html
Reads ./app/ and recognizes templates
Description
In the root directory of the project (Init::root_path) the app directory is searched.
Template files are logically located in this directory.
Each file must be named and have the extension .html
Example:
- index template: ./app/module_name/class_name/index.html
- not_found template: ./app/module_name/class_name/not_found.html
module_name - Name of the module
class_name - Class name
Use in the template:
To get a template, it is enough to set the this.render("template") function
If no template is found, the asnwer will be None.
Used symbols
@ - If it is at the beginning, then do not change the expression after it, but simply remove this symbol {{- trim left -}} trim right {{ name }} htmlspecialchar {{ name.title }} htmlspecialchar {{ name.title.title_ua }} htmlspecialchar {{ name|raw }} {# comment #}
{% if bool %} {% if bool|len %} {% if bool|set %} {% if bool|unset %} {% if int > 0 %} > >= < <= = != {% elseif … %} {% else … %} {% endif … %}
{% for arr in array %} {{ arr|idx }} {{ arr.title|raw }} {{ arr.body }} {% elsefor %} empty or null array {% endfor %}