chaoyu/app/controller/Index.php

17 lines
485 B
PHP
Raw Normal View History

<?php
namespace app\controller;
use app\model\{Category, Block};
class Index extends Base
{
public function index()
{
$category = Category::getIndex();
$categoryId = $category['id'] ?? 0;
$this->data['categoryId'] = $categoryId;
$this->setSeo($this->system['seo_title'], $this->system['seo_keywords'], $this->system['seo_description']);
$this->data['blocks'] = Block::getByCategoryId($categoryId);
return $this->view();
}
}