<div id="breadcrumbs">
{#app.request.attributes.get('_route')#}
{# app.request.server.get('REQUEST_URI') #}
{# dump(app.request.requestUri) #}
{# ページ #}
{% set route = app.request.attributes.get('_route') %}
{# dump(route) #}
{% if route == '' %}
{% elseif route == 'product_list' %}{# カテゴリー #}
{% set this_pate = repository('Eccube\\Entity\\Page').getByUrl( route ) %}
{% if Category is null %}
<a href="{{ url('homepage') }}">TOP</a> > <span>{{ this_pate.name }}</span>
{% else %}
<a href="{{ url('homepage') }}">TOP</a> > <a href="{{ url(route) }}">{{ this_pate.name }}</a> > <span>{{Category.name}}</span>
{% endif %}
{% elseif route == 'product_detail' %}{# 商品詳細 #}
{#dump(Product) #}
{% set categorys = repository('Eccube\\Entity\\Category').getList() %}
{% for category in categorys %}
{% for pcat in Product.ProductCategories %}
{% if category.id == pcat.category_id %}
{# dump(category) #}
{# dump(pcat) #}
<a href="{{ url('homepage') }}">TOP</a> > <a href="/products/list?category_id={{ category.id }}">{{ category.name }}</a> > <span>{{ Product.name }}</span>
{% endif %}
{% endfor %}
{% endfor %}
{% elseif route == 'user_data' %}
{#dump(Page)#}
<a href="{{ url('homepage') }}">TOP</a> > <span>{{Page.name}}</span>
{% else %}
{% set this_pate = repository('Eccube\\Entity\\Page').getByUrl( route ) %}
<ul>
<a href="{{ url('homepage') }}">TOP</a> > <span>{{ this_pate.name }}</span>
<ul>
{% endif %}
</div>