Maslosoft Framework Documentation
Flexible Application Foundation
Smart Menu Link Icon
Adding icon with predefined class
As mentioned in smart menu documentation icons can be added
by using predefined class, or by extending it. In this example
we will be using SmartMenuLink
class.
To define this kind of icon, there need to be defined few of its properties:
-
$href
: URI where icon link should point to -
$icon
: Font awesome icon name, including prefix, for examplefa-snowflake-o
-
$title
: Icon title, displayed as a tooltip
Example of adding icon with SmartMenuLink
:
Smart::fly()->add(SmartMenuLink::widget([
'href' => 'http://example.com/',
'icon' => 'fa-snowflake-o',
'title' => 'Example icon added here'
]));
As this is live documentation, this icon is now visible when You open menu by clicking icon on top of page.