You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should use prepend() to add icon before link or append() to add icon after link.
For example using FontAwaresome Icons: $menu->add($oMenu->name, "danh-muc-san-pham/" . $oMenu->path)->prepend('<i class="fa-solid fa-briefcase"></i>');
Or another way, you can use only icon without text, replace $oMenu->name with the icons tag: $menu->add('<i class="fa-solid fa-briefcase"></i>', "danh-muc-san-pham/" . $oMenu->path);
Hope this help.
Hi everybody . I want to build a menu and have an icon. So how should I do it? I don't know how to pass pictures in
I have the code
private function createMenus($menu, $aMenus, $parent_id)
{
foreach ($aMenus as $oMenu) {
if ($oMenu->parent_id == $parent_id) {
$submenu = $menu->add($oMenu->name, "danh-muc-san-pham/" . $oMenu->path);
$this->createMenus($submenu, $aMenus, $oMenu->id);
}
}
}
The text was updated successfully, but these errors were encountered: