Answer the question
In order to leave comments, you need to log in
How to write such code natively without a template engine?
Hello everyone, I'm learning PHP and I need to implement MVC, I'll deal with the controller and model myself, but I'm interested in this.
How to write such code as in TWIG'e, but natively in PHP?
{% if isAdmin %}
<div>Привет админ, пора за работу!</div>
{% else %}
<div>Приветствую пользователь!</div>
{% endif %}
echo '<div class="block"></div>';
$block = <<< EOF
<div class="block"></div>
EOF;
Answer the question
In order to leave comments, you need to log in
<?if ($isAdmin === true) : ?>
<div>Привет админ, пора за работу!</div>
<?else : ?>
<div>Приветствую пользователь!</div>
<?endif?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question