public function appendFolder($label, array $attributes = array()) { $folder = new MenuFolder($attributes); $folder->setLabel($label); $this->addMenuItem($folder); return $folder; }
public function testMenuFolder() { $menu = new MenuFolder('Products'); $item1 = $menu->appendLink('Car', ['href' => '/products/car']); ok($item1); $item2 = $menu->appendLink('Bicycle', ['href' => '/products/bicycle']); ok($item2); $item3 = $menu->appendLink('Truck', ['href' => '/products/truck']); ok($item3); $item4 = $menu->appendLink('Others', ['href' => '/products/others']); ok($item4); $html = $menu->render(); //var_dump( $html ); // file_put_contents('test.html', '<html><head><style> </style></head><body>' . $html . '</body></html>'); }