CRUDKit api-doc [Developer]

PageStore
in package

Object to store an access all the pages (bundeling)

Table of Contents

$categoryIcons  : mixed
$menuLinks  : mixed
$pageDescriptors  : array<string|int, PageDescriptor>
__construct()  : mixed
Constructor
addMenuLink()  : PageStore
addPageDescriptor()  : mixed
Adds a single page.
getPageDescriptor()  : PageDescriptor
Gets a page
getPageDescriptors()  : array<string|int, PageDescriptor>
Gets all pages
getPageMap()  : array<string|int, string>
Gets an array of pages with and without categories.
setCategoryFaIcon()  : PageStore
insertMenuLink()  : mixed

Properties

$categoryIcons

private mixed $categoryIcons = []

Methods

__construct()

Constructor

public __construct([array<string|int, PageDescriptor$pageDescriptors = [] ]) : mixed
Parameters
$pageDescriptors : array<string|int, PageDescriptor> = []
Return values
mixed
public addMenuLink(string $name, string $url[, string $position = '' ][, string $pageId = '' ][, string $category = '' ][, string $id = '' ]) : PageStore
Parameters
$name : string

The name of the link

$url : string
$position : string = ''

'before'|'after'|'' (use empty if there is no reference page - for example if its the only link present)

$pageId : string = ''

The id of the page in combination with $position sets the position of the menu link

$category : string = ''

Name of the category. A category groups one or more links in a named submenu.

$id : string = ''

If this id matches a crudkit pageId, then the link will be marked as active on the page with this id

Return values
PageStore

getPageDescriptor()

Gets a page

public getPageDescriptor([string $pageId = '' ][, bool $errorIfPageNotFound = false ]) : PageDescriptor
Parameters
$pageId : string = ''

ID of the Page

$errorIfPageNotFound : bool = false

Throw an Error if the page is not found

Return values
PageDescriptor

getPageMap()

Gets an array of pages with and without categories.

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

setCategoryFaIcon()

public setCategoryFaIcon(string $category, string $faIcon) : PageStore
Parameters
$category : string

The name of the category

$faIcon : string

The name of the font awesome icon

Return values
PageStore
private insertMenuLink(array<string|int, mixed> &$pageMap, string $pageId, string $position, string $category[, bool $direct = false ]) : mixed
Parameters
$pageMap : array<string|int, mixed>
$pageId : string
$position : string
$category : string
$direct : bool = false
Return values
mixed

Search results