cergey-obr
6/2/2016 - 4:07 AM

Генерация 404 страницы

Генерация 404 страницы

<?php
	public function gen404() {
		$cmsController = cmsController::getInstance();
		$currentTemplater = $cmsController->getCurrentTemplater();
		$globalVars = $cmsController->getGlobalVariables(true);
		$globalVars['@module'] = 'content';
		$globalVars['@method'] = 'notfound';
		$globalVars['@header'] = 'Страница не найдена';
		$globalVars['@title']  = $globalVars['@site-name'].' - Страница не найдена';
		$templatesSource = $currentTemplater->getTemplatesSource();
		list($commonTemplate) = $currentTemplater->getTemplates($templatesSource, 'common');
		$result = $currentTemplater->parse($globalVars, $commonTemplate);
		$buffer = OutputBuffer::current('HTTPOutputBuffer');
		$buffer->status('404 Not found');
		$buffer->push($result);
		$buffer->end();
	}
?>