F2m2\Apidocs\Commands\ApiDocsGenerator::updateAndSaveDefaultLayoutTemplate PHP Method

updateAndSaveDefaultLayoutTemplate() protected method

Saves the default layout with HTML content
protected updateAndSaveDefaultLayoutTemplate ( string $content ) : void
$content string
return void
    protected function updateAndSaveDefaultLayoutTemplate($content)
    {
        $type = 'layouts';
        $path = Config::get('apidocs.default_layout_template_path');
        $file = File::get($path);
        $file = str_replace('{prefix}', $this->dotPrefix, $file);
        $file = str_replace('{navigation}', $content['navigation'], $file);
        $file = str_replace('{body-content}', $content['body-content'], $file);
        $logo_path = str_replace('{prefix}', $this->dotPrefix, Config::get('apidocs.logo_path'));
        $file = str_replace('{logo-path}', $logo_path, $file);
        $newPath = $this->viewPathForType($type) . basename($path);
        File::put($newPath, $file);
    }