<?php
    //======================================================================================================================
    //Виджет, который получает массив данных о партнёрах, и делает html код для карусели
    
    namespace frontend\widgets;
    
    use yii\base\Widget;
    use common\models\Partner;
    
    class ParthnersList extends Widget
    {
        public $filesList = [];
        public $parthnersLinkList = [];
        public function init()
        {
            parent::init();
            #$this->filesList=preg_grep('$^customer-\d{1,3}\.(png|jpg|jpeg)$',scandir('../web/img',0));
            $this->filesList = Partner::find()
                                      ->where([ 'status' => true ])
                                      ->all();
            
        }
        
        public function run()
        {
            parent::run();
            return $this->render('_parthnerList', [ 'data' => $this->filesList ]);
        }
    }

