AboutSectionController.php 942 Bytes
<?php

class AboutSectionController extends NodeSectionController
{
    public function actionIndex()
    {
        /** @var $aboutRoot AboutRoot */
        $aboutRoot = AboutRoot::model()->with('i18n')->findByPk($this->getRootNode()->data_id);
        /** @var $textSection TextPage */
        $textSection = TextPage::model()->with('i18n')->findByPk($this->getNode()->data_id);
        $this->pageName = $textSection->i18n->page_name;
        $this->setSEOParams($textSection->i18n->title, $textSection->i18n->keywords, $textSection->i18n->description);

        $this->setContacts(explode(',', $textSection->contacts_data));
        $this->setContacts(explode(',', $aboutRoot->contacts_data));

        $this->headerGalleryId = $aboutRoot->header_gallery_id;
        $this->sectionGalleryId = $textSection->header_gallery_id;

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