TWIG неопределенный индекс на мобильном телефоне
У меня проблема с движком шаблонов TWIG. Я не совсем понимаю, что происходит. Когда я просматриваю свою страницу через настольный компьютер, все работает нормально, но когда я использую свой мобильный телефон, я всегда получаю три одинаковые ошибки.
неопределенный индекс: профиль
неопределенный индекс: site_fees
неопределенный индекс: аккаунт
это строки, которые не определены правильно.
$context['_seq'] = twig_ensure_traversable($context["profile"]);
$context['_seq'] = twig_ensure_traversable($context["site_fees"]);
$context['_seq'] = twig_ensure_traversable($context["account"]);
Это вся функция
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['page_list'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 81
echo "
<div class=\"work-listinfo clearfix cnt\" id=\"profile\">
<ul>
";
// line 84
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($context["profile"]);
foreach ($context['_seq'] as $context["_key"] => $context["profile"]) {
// line 85
echo " <li>
";
// line 86
if ((session_get("language_id") == 2)) {
// line 87
echo " <a href=\"";
echo twig_escape_filter($this->env, base_url(), "html", null, true);
echo "how_does_it_work/page_description/";
echo twig_escape_filter($this->env, $this->getAttribute($context["profile"], "id", array()), "html", null, true);
echo "\">";
echo $this->getAttribute($context["profile"], "title_in_french", array());
echo "</a>
";
} elseif ((session_get("language_id") == 3)) {
// line 89
echo " <a href=\"";
echo twig_escape_filter($this->env, base_url(), "html", null, true);
echo "how_does_it_work/page_description/";
echo twig_escape_filter($this->env, $this->getAttribute($context["profile"], "id", array()), "html", null, true);
echo "\">";
echo $this->getAttribute($context["profile"], "title_in_german", array());
echo "</a>
";
} elseif ((session_get("language_id") == 1)) {
// line 91
echo " <a href=\"";
echo twig_escape_filter($this->env, base_url(), "html", null, true);
echo "how_does_it_work/page_description/";
echo twig_escape_filter($this->env, $this->getAttribute($context["profile"], "id", array()), "html", null, true);
echo "\">";
echo $this->getAttribute($context["profile"], "title_in_english", array());
echo "</a>
";
} else {
// line 93
echo " <a href=\"";
echo twig_escape_filter($this->env, base_url(), "html", null, true);
echo "how_does_it_work/page_description/";
echo twig_escape_filter($this->env, $this->getAttribute($context["profile"], "id", array()), "html", null, true);
echo "\">";
echo $this->getAttribute($context["profile"], "title_in_english", array());
echo "</a>
";
}
// line 95
echo " </li>
";
}
Я не понимаю, почему это работает правильно на моем компьютере. У кого-нибудь есть ключ?
Изменить: его пробовал в приватной вкладке и все тот же вопрос. Вот код TWIG.
{% extends 'layouts/home.twig' %}
{% block title %} How it work {% endblock %}
{% block content %}
<div class="inner-banner">
<div class="wrapper">
<div class="inner-title">
<h2>How On Boat Works</h2>
</div>
</div>
</div>
<div class="container clearfix">
<div class="wrapper">
<div class="my-accountcontain content clearfix">
<aside class="my-accountlf how_te_wrk">
<div class="dash-boardnav">
<div class="dash-boardlist">
<ul>
{% for page_list in page_list %}
<li onclick="view_content('{{page_list.id}}')"><a href="javascript:void(0);" id="l_{{page_list.id}}">
{% if (session_get('language_id')==1) %}
{{page_list.pagename_in_english}}
{% elseif (session_get('language_id')==2) %}
{{page_list.pagename_in_french}}
{% elseif (session_get('language_id')==3) %}
{{page_list.pagename_in_german}}
{% elseif (session_get('language_id')==4) %}
{{page_list.pagename_in_spanish}}
{% else %}
{{page_list.pagename_in_english}}
{% endif %}
</a></li>
{% endfor %}
</ul>
</div>
</div>
</aside>
<aside class="my-accountrh how_te_wrk_rt">
{% set counter = 0 %}
{% for page_list in page_list %}
{% set counter = counter + 1 %}
{% set datas = get_how_it_work_page_content(page_list.id) %}
<div class="work-listinfo clearfix cnt" id="{{page_list.id}}" {% if (counter==1) %} style="display:block;" {% endif %}>
<ul>
{% for data in datas %}
<li>
{% if (session_get('language_id')==2) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{data.id}}">
{{ data.title_in_french }}
</a>
{% elseif (session_get('language_id')==3) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{data.id}}">
{{ data.title_in_german }}
</a>
{% elseif (session_get('language_id')==1) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{data.id}}">
{{ data.title_in_english | raw }}
</a>
{% elseif (session_get('language_id')==4) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{data.id}}">
{{ data.title_in_spanish | raw }}
</a>
{% else %}
<a href="{{base_url()}}how_does_it_work/page_description/{{data.id}}">
{{ data.title_in_english | raw }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
<div class="work-listinfo clearfix cnt" id="profile">
<ul>
{% for profile in profile %}
<li>
{% if (session_get('language_id')==2) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{profile.id}}">{{ profile.title_in_french | raw }}</a>
{% elseif (session_get('language_id')==3) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{profile.id}}">{{ profile.title_in_german | raw }}</a>
{% elseif (session_get('language_id')==1) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{profile.id}}">{{ profile.title_in_english | raw }}</a>
{% else %}
<a href="{{base_url()}}how_does_it_work/page_description/{{profile.id}}">{{ profile.title_in_english | raw }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
<div class="work-listinfo clearfix cnt" id="who_we_are_2">
<ul>
{% for site_fees in site_fees %}
<li>
{% if (session_get('language_id')==2) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{site_fees.id}}">{{ site_fees.title_in_french | raw }}</a>
{% elseif (session_get('language_id')==3) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{site_fees.id}}">{{ site_fees.title_in_german | raw }}</a>
{% elseif (session_get('language_id')==1) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{site_fees.id}}">{{ site_fees.title_in_english | raw }}</a>
{% else %}
<a href="{{base_url()}}how_does_it_work/page_description/{{site_fees.id}}">
{{ site_fees.title_in_english | raw }}
</a>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<div class="work-listinfo clearfix cnt" id="account">
{% for account in account %}
{% set counter = counter + 1 %}
{% if counter==5 or counter==9 %}
</ul>
{% endif %}
{% if counter==1 or counter==5 %}
<ul>
{% endif %}
<li>
{% if (session_get('language_id')==2) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{account.id}}">{{ account.title_in_french | raw }}</a>
{% elseif (session_get('language_id')==3) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{account.id}}">{{ account.title_in_german | raw }}</a>
{% elseif (session_get('language_id')==1) %}
<a href="{{base_url()}}how_does_it_work/page_description/{{account.id}}">{{ account.title_in_english | raw }}</a>
{% else %}
<a href="{{base_url()}}how_does_it_work/page_description/{{account.id}}">
{{ account.title_in_english | raw }}
</a>
{% endif %}
</a>
</li>
{% endfor %}
</div>
</aside>
</div>
</div>
</div>
{% endblock %}
{% block script %}
<script type="text/javascript">
$(document).ready(function() {
$("#area-slide").owlCarousel({
items: 3,
navigation: true,
pagination: false,
});
});
</script>
<script type="text/javascript">
$(window).load(function(){
$("[data-toggle]").click(function() {
var toggle_el = $(this).data("toggle");
$(toggle_el).toggleClass("open-sidebar");
});
});
function view_content(id){
$('.active').removeClass('active');
$('#l_'+id).addClass('active');
$('.cnt').css('display', 'none');
$('#'+id).css('display', 'block');
}
</script>
{% endblock %}