Documentation

Pages
in package

Contains data about all the registered pages in the application.

Tags
author

Samerton

version
2.0.0-pr8
license

MIT

Table of Contents

Properties

$_active_page  : array<string|int, mixed>
$_ajax_requests  : array<string|int, mixed>
$_id  : int
$_pages  : array<string|int, mixed>
$_sm_methods  : array<string|int, callable>

Methods

add()  : void
Defines a page and assigns it to a module.
addAjaxScript()  : void
Add a script for Javascript to perform a GET request to.
addCustom()  : void
Defines a custom page.
getActivePage()  : array<string|int, mixed>
Get the page details the user currently viewing.
getAjaxScripts()  : array<string|int, mixed>
Get scripts for Javascript to perform a GET request to.
getPageById()  : array<string|int, mixed>
Get page by ID.
getPageByURL()  : array<string|int, mixed>
Get page by URL.
getSitemapMethods()  : array<string|int, callable>
Get registered sitemap methods.
registerSitemapMethod()  : void
Register a method for sitemap generation.
returnPages()  : array<string|int, mixed>
Get array of all pages.
returnWidgetPages()  : array<string|int, mixed>
Return pages which allow widgets.
setActivePage()  : void
Set the page the user currently viewing.

Properties

$_active_page

private array<string|int, mixed> $_active_page = []

Array of data about the active page.

$_ajax_requests

private array<string|int, mixed> $_ajax_requests = []

Array of URLs to call with ajax.

$_id

private int $_id = 1

ID of last created page.

$_pages

private array<string|int, mixed> $_pages

Array of all the registered pages.

$_sm_methods

private array<string|int, callable> $_sm_methods = []

Array of sitemap files and methods.

Methods

add()

Defines a page and assigns it to a module.

public add(string $module, string $url, string $file[, string $name = '' ][, bool $widgets = false ]) : void
Parameters
$module : string

Module which the page belongs to.

$url : string

URL string.

$file : string

Path (from module folder) to page file.

$name : string = ''

Name of page.

$widgets : bool = false

Can widgets be used on the page? Default false.

addAjaxScript()

Add a script for Javascript to perform a GET request to.

public addAjaxScript(string $script) : void
Parameters
$script : string

URL of js script to add.

addCustom()

Defines a custom page.

public addCustom(string $url, string $name[, bool $widgets = false ]) : void
Parameters
$url : string

URL string.

$name : string

Name of page.

$widgets : bool = false

Can widgets be used on the page? Default false.

getActivePage()

Get the page details the user currently viewing.

public getActivePage() : array<string|int, mixed>
Return values
array<string|int, mixed>

Details of current page.

getAjaxScripts()

Get scripts for Javascript to perform a GET request to.

public getAjaxScripts() : array<string|int, mixed>
Return values
array<string|int, mixed>

All registered ajax script URLs.

getPageById()

Get page by ID.

public getPageById(int $page_id) : array<string|int, mixed>
Parameters
$page_id : int

ID of page to find.

Return values
array<string|int, mixed>

Page information.

getPageByURL()

Get page by URL.

public getPageByURL(string $url) : array<string|int, mixed>
Parameters
$url : string

URL of page to find.

Return values
array<string|int, mixed>

Page information.

getSitemapMethods()

Get registered sitemap methods.

public getSitemapMethods() : array<string|int, callable>
Return values
array<string|int, callable>

Array of sitemap methods.

registerSitemapMethod()

Register a method for sitemap generation.

public registerSitemapMethod(callable $method) : void
Parameters
$method : callable

Array callable of the sitemap class and method to execute.

Tags
see
Sitemap

returnPages()

Get array of all pages.

public returnPages() : array<string|int, mixed>
Return values
array<string|int, mixed>

All pages.

returnWidgetPages()

Return pages which allow widgets.

public returnWidgetPages() : array<string|int, mixed>
Return values
array<string|int, mixed>

All pages which allow widgets.

setActivePage()

Set the page the user currently viewing.

public setActivePage(array<string|int, mixed> $page) : void
Parameters
$page : array<string|int, mixed>

        
On this page

Search results