protected function addIcon($item, $icon)
{
$icon = array_merge(array('tag' => isset($icon['glyphicon']) ? 'span' : 'i'), $icon);
$addclass = "";
if (isset($icon['inverted']) && $icon['inverted'] === true) {
$addclass = " icon-white";
}
$classicon = isset($icon['glyphicon']) ? ' class="' . $icon['glyphicon'] : ' class="fa fa-' . $icon['icon'];
$myicon = ' <' . $icon['tag'] . $classicon . $addclass . '"></' . $icon['tag'] . '>';
if (!isset($icon['append']) || $icon['append'] === true) {
$label = $item->getLabel() . " " . $myicon;
} else {
$label = $myicon . " " . $item->getLabel();
}
$item->setLabel($label)->setExtra('safe_label', true);
return $item;
}