Closed devleaks closed 9 years ago
Icon::map
is a shortcut to load the assets (CSS) for the relevant Icon on the page - it does not set the framework.
You must use Icon::show
to mention what icon you render and with what framework i.e. Icon::show('podium-winner', [], Icon::WHHG)
as you said.
If you do not provide a framework in Icon::show
then it will read it from the icon-framework
in params
.
Generally ONE default icon framework is used across the app. So that's the way it is...
If for some reasons you need two different frameworks (say FA & WHHG) for two different views... you can create two view layouts
In view layout 1:
// view_layout_fa.php
Icon::map($this, Icon::FA);
Yii::$app->params['icon_framework'] = Icon::FA;
In view layout 2:
// view_layout_whhg.php
Icon::map($this, Icon::WHHG);
Yii::$app->params['icon_framework'] = Icon:WHHG;
Then use view_layout_fa
or view_layout_whhg
as the case maybe in your views. Then you do not need to provide the framework in Icon::show
.
Hello,
In the head of a view, I Icon::map($this, Icon::WHHG); and still get The 'icon-framework' option has not been setup in Yii params. Check your configuration file.
If I add 'icon-framework' => 'fa' in params.php file, error disappear but Icon::show('podium-winner') (specific WHHG icon) does not show anything because 'fa' still selected, in spite of Icon::map($this, Icon::WHHG).
Works OK if I use global 'icon-framework' => 'whhg' in params. Works OK if I use Icon::show('podium-winner', [], Icon::WHHG).
Thank you.
P.