protected static function compileWith(array $layoutTplVars)
    {
        if (static::$filename === null) {
            throw new \Exception('Layout template file name does not set: use Layout::setFilename().');
        }

        $tpl       = new PhpTemplate(VIEWS . static::$filename);
        $tpl->vars = $layoutTplVars;

        $compiledHtml = $tpl->compile();
        foreach ($layoutTplVars as $key => $value) {
            $compiledHtml = str_replace('{' . $key . '}', $value, $compiledHtml);
        }

        return $compiledHtml;
    }