Icon::map method allows you to initialize assets for a specific icon framework in your view.
The parameters available for this method are:
view: The view object to initialize this framework. Usually you would set it to $this
when calling within a view or view layout file.framework: The icon-framework identifier to map to the view.
You can use one of the Icon framework constants below:
Icon::BSG or "bsg" for Bootstrap GlyphiconsIcon::FA or "fa" for Font Awesome IconsIcon::FAS or "fas" for Font Awesome 5.x Solid IconsIcon::FAR or "far" for Font Awesome 5.x Regular IconsIcon::FAB or "fab" for Font Awesome 5.x Brand IconsIcon::FAL or "fal" for Font Awesome 5.x Light Icons (not available free)Icon::UNI or "uni" for Krajee Uni IconsIcon::EL or "el" for Elusive IconsIcon::TYP or "typ" for TypiconsIcon::WHHG or "whhg" for Web Hosting Hub GlyphsIcon::JUI or "jui" for JQuery UI IconsIcon::SI or "si" for SociconIcon::OCT or "oct" for Github OcticonsIcon::FI or "fi" for Flag IconsIcon::OI or "oi" for Open Iconic IconsNot seeing the updated content on this page! Hard refresh your browser to clean cache for this page (e.g. SHIFT-F5 on Windows Chrome)
icon-framework as a param in your Yii Configuration file. This will have one of the values as determined by the Icon framework constants. Icon::BSG or "bsg" for Bootstrap GlyphiconsIcon::FA or "fa" for Font Awesome IconsIcon::FAS or "fas" for Font Awesome 5.x Solid IconsIcon::FAR or "far" for Font Awesome 5.x Regular IconsIcon::FAB or "fab" for Font Awesome 5.x Brand IconsIcon::FAL or "fal" for Font Awesome 5.x Light Icons (not available free)Icon::UNI or "uni" for Krajee Uni IconsIcon::EL or "el" for Elusive IconsIcon::TYP or "typ" for TypiconsIcon::WHHG or "whhg" for Web Hosting Hub GlyphsIcon::JUI or "jui" for JQuery UI IconsIcon::SI or "si" for SociconIcon::OCT or "oct" for Github OcticonsIcon::FI or "fi" for Flag IconsIcon::OI or "oi" for Open Iconic Icons// Yii Config File
...
params => [
'icon-framework' => 'el' // set elusive icon font as default framework
];
...
// Call this in the view layout (typically at the head section)
use kartik\icons\Icon;
Icon::map($this);
Icon::BSG or "bsg" for Bootstrap GlyphiconsIcon::FA or "fa" for Font Awesome IconsIcon::FAS or "fas" for Font Awesome 5.x Solid IconsIcon::FAR or "far" for Font Awesome 5.x Regular IconsIcon::FAB or "fab" for Font Awesome 5.x Brand IconsIcon::FAL or "fal" for Font Awesome 5.x Light Icons (not available free)Icon::UNI or "uni" for Krajee Uni IconsIcon::EL or "el" for Elusive IconsIcon::TYP or "typ" for TypiconsIcon::WHHG or "whhg" for Web Hosting Hub GlyphsIcon::JUI or "jui" for JQuery UI IconsIcon::SI or "si" for SociconIcon::OCT or "oct" for Github OcticonsIcon::FI or "fi" for Flag IconsIcon::OI or "oi" for Open Iconic Icons// Call another framework even if Yii::$app->params['icon-framework'] is set to something else use kartik\icons\Icon; Icon::map($this, Icon::WHHG); // Call multiple icon frameworks in one single view // Note: This may affect rendering performance depending on the size of the framework assets. use kartik\icons\Icon; Icon::map($this, Icon::EL); Icon::map($this, Icon::TYP);
Comments & Discussion
Note
You can now visit the Krajee Webtips Q & A forum for searching OR asking questions OR helping programmers with answers on these extensions and plugins. For asking a question click here. Select the appropriate question category (i.e. Krajee Plugins) and choose this current page plugin in the question related to field.
The comments and discussion section below are intended for generic discussions or feedback for this plugin. Developers may not be able to search or lookup here specific questions or tips on usage for this plugin.