<?php

namespace kernel\widgets;

use kernel\models\Menu;
use kernel\Widget;

class MenuWidget extends Widget
{

    public function run(): void
    {
        $menu = Menu::where("parent_id", 0)->get()->sortBy("priority");
        $this->cgView->render('/admin/menu.php', ['menu' => $menu]);
    }

}