OpenCart 🇺🇦

Схема

public void index ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Устанавливает заголовок (тег title) документа и meta-тег description, помещая в них значения из конфигурации сайта (т.е. те, которые прописаны в конфигурации как таковые по-умолчанию):
$this->document->setTitle($this->config->get('config_title'));
$this->document->setDescription($this->config->get('config_meta_description'));

Если не найден нужный шаблон (common/home) в папке с текущей темой, то ищет такой файл в папке со стандартной темой и выбирает его в качестве загружаемого:
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
	$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
} else {
	$this->template = 'default/template/common/home.tpl';
}

Генерирует содержимое вложенных контроллеров и возвращает полностью сгенерированную страницу:
$this->children = array(
	'common/column_left',
	'common/column_right',
	'common/content_top',
	'common/content_bottom',
	'common/footer',
	'common/header'
);
								
$this->response->setOutput($this->render());

Исходный код

$this->document->setTitle($this->config->get('config_title'));
$this->document->setDescription($this->config->get('config_meta_description'));

$this->data['heading_title'] = $this->config->get('config_title');

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
	$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
} else {
	$this->template = 'default/template/common/home.tpl';
}

$this->children = array(
	'common/column_left',
	'common/column_right',
	'common/content_top',
	'common/content_bottom',
	'common/footer',
	'common/header'
);
								
$this->response->setOutput($this->render());