Mecha CMS

Deep learning on using the API.

Class Get

Author: Taufik Nurrohman · 51 Views

Tweet

Data caller.

Table of Content

Internet Protocol 

Get user’s IP.

Get::ip($fail = false);

User Agent 

Get user’s user agent.

Get::ua($fail = false);

Page 

Plugged by page extension.

Get::page($path, $key = null, $fail = false, $for = null);

Pages 

Plugged by page extension.

Get::pages($folder = PAGE, $state = 'page', $sort = [-1, 'time'], $key = null);

Example:

List all published and archived pages from lot\page\blog and sort them by slug ascending:

$files = Get::pages('.\www\lot\page\blog', 'page,archive', [1, 'slug']);

List all published and archived pages from lot\page\blog and sort them ascending by slug, output only the path property of each item returned:

$files = Get::pages('.\www\lot\page\blog', 'page,archive', [1, 'slug'], 'path');

0 Comments

No comments yet.