StoFilterController.php
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class StoFilterController extends Controller
{
    /** @var array General Section Params */
    public $generalData;
    public function init()
    {
        parent::init();
        /** @var $sectionData StaticData */
        $sectionData = StaticData::model()->with('i18n')->findByPk(array('section' => $this->id, 'key' => 'general'));
        $this->generalData = $sectionData->getDataAttributes() + $sectionData->i18n->getDataAttributes();
        $this->headerGalleryId = $this->generalData['gallery_id'];
    }
    public function actionIndex(){
        $data = $this->loadStaticPage($this->id, $this->action->id);
        $this->sectionGalleryId = $data['gallery_id'];
        $this->setContacts($data['contacts']);
        $this->setContacts($this->generalData['contacts']);
        $brands = StoFilter::model()->findAll(array(
            'select'=>'brand',
            'group'=>'brand',
            'distinct'=>true,
            ));
        $this->render('index', array(
            'content' => $data['content'],
            'brands' =>$brands
        ));
    }
}