chaoyu/app/widget/Footer.php

23 lines
528 B
PHP
Raw Normal View History

2020-11-25 10:48:29 +00:00
<?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');
}
}