'Каталог продукции - Рыбсток', 'metaDescription' => 'Полный каталог Рыбсток: рыба, морепродукты, икра, мясо, сыры, полуфабрикаты и продукты с доставкой.', 'metaKeywords' => 'каталог Рыбсток, рыба, морепродукты, мясо, сыры, полуфабрикаты', 'breadcrumbs' => [ ['title' => 'Главная', 'url' => '/'], ['title' => 'Каталог'], ], 'categories' => $categoryRepository->tree(), 'currentCategory' => null, 'products' => $productRepository->catalogPreview(48), ]); } public function category(string $slug): void { $categoryRepository = new CategoryRepository(); $productRepository = new ProductRepository(); $category = $categoryRepository->findBySlug($slug); if ($category === null) { http_response_code(404); view('pages/404', [ 'title' => 'Категория не найдена - Рыбсток', 'breadcrumbs' => [ ['title' => 'Главная', 'url' => '/'], ['title' => 'Каталог', 'url' => '/catalog'], ['title' => 'Категория не найдена'], ], ]); return; } view('catalog/index', [ 'title' => ($category['seo_title'] ?: $category['name']) . ' - Рыбсток', 'metaDescription' => $category['seo_description'] ?: '', 'metaKeywords' => $category['seo_keywords'] ?: '', 'breadcrumbs' => $categoryRepository->breadcrumbs((int) $category['id']), 'categories' => $categoryRepository->tree(), 'currentCategory' => $category, 'products' => $productRepository->forCategory((int) $category['id'], 48), ]); } }