<?php
namespace app\widget;

use app\model\Category;
use think\facade\View;

class Crumbs
{
    public function index($categoryId)
    {
        $list = array_reverse(Category::getListForCrumbs($categoryId));
        $data = [
            'crumbs' => $list
        ];
        return View::assign($data)->fetch('public/crumbs');
    }

}