<?php
namespace Gear\CMS\Basic;
use Gear\CMS\Basic\UI\BasicUI;

class Menu extends Element
{
	public function default():\Gear\Framework\Renderable
	{
	    $ui = new BasicUI($this->getTheme());
		$list = $ui->list();

		$data = $this->db()["basic_menu"]->ord(0, ">")->orderBy("ord", false)->all();
		foreach ($data as $value) 
		{
            $list->add($ui->ref($this->router()->fromID($value["route"]), $value["title"]));
		}

		return $list;
	}
}