<?php

class AboutController extends NodeSiteController
{
    /** @var AboutRoot */
    public $aboutRoot;

    public function init()
    {
        parent::init();
        $this->aboutRoot = AboutRoot::model()->with('i18n')->findByPk($this->getNode()->data_id);
        $this->headerGalleryId = $this->aboutRoot->header_gallery_id;
    }

    public function actionIndex()
    {
        $this->pageName = $this->aboutRoot->i18n->page_name;
        $this->setSEOParams($this->aboutRoot->i18n->title, $this->aboutRoot->i18n->keywords, $this->aboutRoot->i18n->description);

        $this->sectionGalleryId = $this->aboutRoot->header_gallery_id;
        $this->setContacts(explode(',',$this->aboutRoot->contacts_data));

        $this->render('index', array(
            'content' => $this->aboutRoot->i18n->content,
        ));
    }
}