Answer the question
In order to leave comments, you need to log in
"if" not working in twig template engine?
Good afternoon. The twig template engine worked and works on the same server normally.
Decided to transfer to another computer. Gives an error message
*An exception has been thrown during the compilation of a template ("Class "Twig_Node_Expression_Binary_Equal" not found in "C:\OpenServer\OpenServer\domains\testlocal\application/Core/Twig_Node_Expression_Binary_Equal.php" and in "C:\OpenServer\OpenServer\domains\testlocal\application/Twig/Twig_Node_Expression_Binary_Equal.php"") in "/Templates/MainTemplate_view.html".#0 C:\OpenServer\OpenServer\domains\testlocal\lib\Twig\Environment.php(334): Twig_Environment->compileSource('*
<div class="navbar-inner">
<ul class="nav">
<li class="Menu" ><a ng-class="{'bold': window.location.pathname == '/trainings'}" ng-href="/trainings">Тренировка</a></li>
<li class="Menu" ng-class="{'bold': window.location.pathname == '/exam'}"><a ng-href="/exam">Экзамен</a></li>
{% if role=='1' %} <li class="Menu"><a ng-href="/admin" ng-class="{'bold': location.pathname == '/admin'}">Панель администратора</a></li>{% endif %}
<li class="Menu" ng-class="{'bold': window.location.pathname == '/settings'}"><a ng-href="/settings">Настройки</a></li>
<li class="Menu" ng-class="{'bold': window.location.pathname == '/description'}"><a ng-href="/description">Описание</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><p>{% if role=='1' %}<span class="label label-warning">Администратор</span>{% endif %} ФИО: {{Session_Fio}} -<a href="/logout" id="logout_button" onclick="window.location = '/logout'"> Выход </a></p></li>
</ul>
</div>
function action_mainview()
{
$role =$_SESSION['role'];
echo $this->view->render('/Templates/MainTemplate_view.html', array('role' => $role,'login'=> $_SESSION['User']));
}
Answer the question
In order to leave comments, you need to log in
figured it out. There was a damaged twig. Downloaded from previous backups
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question