Page · Mecha CMS

Working with pages.

$page::unite()

Author: Taufik Nurrohman · 21 Views

Tweet

Generate page file content from array input.

Page::unite($input);

Example:

Convert array input into page file content:

$test = Page::unite([
    'title' => 'Page Title',
    'description' => 'Page description.',
    'author' => 'Taufik Nurrohman',
    'type' => 'HTML',
    'content' => '<p>Page content.</p>'
]);

Result:

---
title: Page Title
description: Page description.
author: Taufik Nurrohman
type: HTML
...

<p>Page content.</p>