Page · Mecha CMS

Working with pages.

$page->get()

Author: Taufik Nurrohman · 21 Views

Tweet

Get one or more data from the currently opened page file.

->get($key = null, $fail = null, $NS = ['*', 'page']);

Example:

Get title property from a page if available, otherwise, return Untitled:

$test = Page::open('path\to\file.page')->get('title', 'Untitled');

Get title and url properties from a page:

$test = Page::open('path\to\file.page')->get([
    'title' => 'Untitled',
    'url' => '#'
]);