code between {% %} is an php expression and code between {{ }} is an output. {{ban. reason}} can be <? php echo $ban["reason"] ?> or sth else. You better figure out what template engine is being used in.
It's a Template Engine system, and its syntax is based on jinja. Another code example:
{% extends "layout.html" %}
{% block body %}
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock %}
from wikipedia:
Template engines typically include features common to most high-level programming languages, with an emphasis on features for processing plain text. Such features include:
(end from wikipedia)
For example instead of writing such this:
<?php echo $var ?>
<?php echo htmlspecialchars($var, ENT_QUOTES, 'UTF-8') ?>
You can do this with Twig:
{{ var }}
{{ var|escape }}
And another example:
<ul id="navigation">
<?php if (navigation) { ?>
<?php foreach ($navigation as $item) { ?>
<li><a href="<?php echo $item->href; ?>"><?php echo $item->caption; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
In template engine:
<ul id="navigation">
{% for item in navigation %}
<li><a href="{{ item.href }}">{{ item.caption }}</a></li>
{% endfor %}
</ul>
This syntax is used by a template engine that reads this file and generates the final HTML. Some of them may be Django or Smarty like @karthikr commented.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With