title = "main-category" url = "/main-category/:id" layout = "default" is_hidden = 0 == param('id'); if($this['id'] != 0){ $this['top_category'] = Tps\Shops\Models\TopCategory::where("id", $this['id'])->get()->first(); }else{ $this['shops'] = Tps\Shops\Models\Shop::orderBy('created_at')->get(); } } ?> ==
{{'Главная'|_}}

{% if id != 0%} {{top_category.name}} {% else %} {{'Все магазины'|_}} {% endif %}

{% if id != 0%} {% for category in top_category.categories %} {% for shop in category.shops%} {% partial 'home/shop_item' shop=shop %} {% endfor %} {% endfor %} {% else %} {% for shop in shops%} {% partial 'home/shop_item' shop=shop %} {% endfor %} {% endif %}