chaoyu/app/widget/Footer.php

23 lines
528 B
PHP

<?php
namespace app\widget;
use app\model\Category;
use app\model\System;
use think\facade\{View,Cache};
class Footer
{
public function index()
{
$menus = Cache::get('front_menus');
if (empty($menus)){
$menus = Category::getListForFrontMenu();
Cache::set('front_menus', $menus, 3600 * 12);
}
$data = [
'system' => System::getSystem(),
'footerMenus' => $menus,
];
return View::assign($data)->fetch('public/footer');
}
}