kartik-v / yii2-icons

Set of icon frameworks for easy use in Yii Framework 2.0
http://demos.krajee.com/icons
Other
71 stars 29 forks source link

PHP notice when icon-framework is not set #1

Closed makroxyz closed 10 years ago

makroxyz commented 10 years ago

Hi just a little bug. If I don't declare icon-framework in params and I call Icon::show('icon', [], Icon::FA) for example, PHP throws a Notice Error in Icon.php line #63

 protected static function getFramework($framework = null) {
        .....
        if (!in_array(Yii::$app->params['icon-framework'], array_keys(self::$_frameworks))) {
        .....
 }

should be

if (isset(Yii::$app->params['icon-framework']) && !in_array(Yii::$app->params['icon-framework'], array_keys(self::$_frameworks))) {
kartik-v commented 10 years ago

Resolved with a few more improvements via commit cd927d0. Thanks for reporting.