CMS\FileLoader::getContent PHP Метод

getContent() публичный Метод

public getContent ( $file ) : mixed | string
$file
Результат mixed | string
    public function getContent($file)
    {
        $ext = pathinfo(strval($file), PATHINFO_EXTENSION);
        $content = filter('content', parent::getContent($file), $file, $ext);
        // Try render page
        if ($file instanceof Page) {
            /** @var Page $file */
            if ($ext === 'html' && substr($content, 0, 15) === '<!doctype html>') {
                return $content;
            }
            if ($ext === 'md') {
                $content = '{block|md}' . $content . '{/block}';
            }
            if (strpos($content, '{block content') === false) {
                $content = '{block content}' . $content . '{/block}';
            }
            if (strpos($content, '{layout') === false) {
                $content = "{layout '{$file->template}'}" . $content;
            }
        }
        //echo '<pre>' . htmlentities($content);die(); // debug
        return $content;
    }
FileLoader