From 9612cf03ccfeabf0ff73ff248664da8b889af59f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 19 Oct 2016 22:54:28 +0300 Subject: [PATCH] big commti --- frontend/widgets/Seo.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index ef747f0..70a773f 100755 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -27,6 +27,7 @@ class Seo extends Widget public $key; public $name; public $project_name; + public static $optionsList; protected static $check_url; protected static $check_url_bool; @@ -41,6 +42,10 @@ class Seo extends Widget { $this->url = \Yii::$app->request->url; $this->project_name = \Yii::$app->name; + if(empty(self::$optionsList)){ + self::$optionsList = ArrayHelper::getColumn(TaxGroup::find()->where(['is_filter' => 'TRUE'])->all(),'alias'); + } + parent::init(); } @@ -222,9 +227,7 @@ class Seo extends Widget } else if ( isset($filter['brands']) && count($filter['brands']) > 1 - || isset($filter["pol"]) && count($filter["pol"]) > 1 - || isset($filter["naznacenie"]) && count($filter["naznacenie"]) > 1 - || isset($filter["god"]) && count($filter["god"]) > 1 + || isset($filter) && $this->checkFilter($filter) ) { $this->getView()->registerMetaTag([ @@ -450,5 +453,16 @@ class Seo extends Widget } + protected function checkFilter($filter){ + foreach(self::$optionsList as $optionList){ + + if(isset($filter[$optionList]) && count($filter[$optionList]) > 1){ + return true; + } + + } + return false; + } + } \ No newline at end of file -- libgit2 0.21.4