Php 移动设备上未定义的细枝索引
我的小树枝模板引擎有问题。我不太明白发生了什么事。当我通过台式pc浏览我的页面时,一切正常,但当我使用手机时,我总是会遇到同样的三个错误 未定义索引:配置文件Php 移动设备上未定义的细枝索引,php,twig,Php,Twig,我的小树枝模板引擎有问题。我不太明白发生了什么事。当我通过台式pc浏览我的页面时,一切正常,但当我使用手机时,我总是会遇到同样的三个错误 未定义索引:配置文件 未定义的索引:站点费用 未定义索引:帐户 这些是没有正确定义的线 $context['_seq'] = twig_ensure_traversable($context["profile"]); $context['_seq'] = twig_ensure_traversable($context["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>
";
}
$\u parent=$context[''u parent'];
取消设置($context[''u seq']、$context[''u iterated']、$context['u key']、$context['page\u list']、$context['u parent']、$context['loop']);
$context=array\u intersect\u key($context,$\u parent)+$\u parent;
//第81行
回声“
";
//第84行
$context[''u parent']=$context;
$context[''u seq']=小枝确保可遍历($context['profile');
foreach($context[''seq']作为$context[“\u key”]=>$context[“profile”]){
//第85行
回声“-
";
//第86行
if((会话获取(“语言id”)==2)){
//第87行
回声“
";
}elseif((会话获取(“语言id”)==3)){
//第89行
回声“
";
}elseif((会话获取(“语言id”)==1)){
//第91行
回声“
";
}否则{
//第93行
回声“
";
}
//第95行
回声“
";
}
我不明白为什么它能在我的电脑上正常工作。有人有线索吗
编辑:它在privat选项卡中尝试过,但仍然是同一个问题。这是细枝代码
{% 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 %}
{%extends'布局/home.twig%}
{%block title%}它的工作原理{%endblock%}
{%block content%}
船上工作原理
{%endfor%}
{%elseif(session_get('language_id')==3)%}
{%elseif(session_get('language_id')==1)%}
{%elseif(session_get('language_id')==4)%}
{%else%}
{%endif%}
{%endfor%}
{%endfor%}
{配置文件%中的配置文件为%1}
-
{%if(session_get('language_id')==2)%}
{%elseif(session_get('language_id')==3)%}
{%elseif(session_get('language_id')==1)%}
{%else%}
{%endif%}
{%endfor%}
{站点费用%中的站点费用%}
-
{%if(session_get('language_id')==2)%}
{%elseif(session_get('language_id')==3)%}
{%elseif(session_get('language_id')==1)%}
{%else%}
{%endif%}
{%endfor%}
{帐户%中帐户的%s}
{%set counter=计数器+1%}
{%如果计数器==5或计数器==9%}
{%endif%}
{%如果计数器==1或计数器==5%}
{%endif%}
-
{%if(session_get('language_id')==2)%}
{%elseif(session_get('language_id')==3)%}
{%elseif(session_get('language_id')==1)%}
{%else%}
{%endif%}
{%endfor%}
{%endblock%}
{%block script%}
$(文档).ready(函数(){
$(“#区域幻灯片”).owlCarousel({
项目:3,
导航:对,
分页:false,
});
});
$(窗口)。加载(函数(){
$(“[数据切换]”)。单击(函数(){
var toggle_el=$(this).data(“toggle”);
$(toggle_el).toggleClass(“打开边栏”);
});
});
功能视图内容(id){
$('.active').removeClass('active');
$('#l'+id).addClass('active');
$('.cnt').css('display','none');
$('#'+id).css('display','block');
}
{%endblock%}
您应该检查桌面上的源代码,而不是依赖您看到的内容。PHP是在服务器上呈现的,与设备无关。注意事项将出现在源代码中,但在屏幕上不可见。请在问题中添加细枝代码(通过编辑),看起来您只添加了编译后的PHP代码。错误很明显:您试图访问数组中不存在的某些索引。这可能与会话有关。尝试在桌面浏览器中打开一个专用选项卡/窗口,并检查是否也显示错误。