Menu

## PageStore
in package

PageStore.php : 14

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

PageStore.php : 19
`private mixed $categoryIcons = []`

#### $menuLinks

PageStore.php : 18
`private mixed $menuLinks = []`

#### $pageDescriptors

PageStore.php : 17
`private array<string|int, PageDescriptor> $pageDescriptors = []`

### Methods

#### __construct()

PageStore.php : 25

Constructor

`public __construct([array<string|int, PageDescriptor> $pageDescriptors = [] ]) : mixed`

##### Parameters

$pageDescriptors : array<string|int, PageDescriptor> = []

##### Return values

mixed —

#### addMenuLink()

PageStore.php : 47
`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 —

#### addPageDescriptor()

PageStore.php : 70

Adds a single page.

`public addPageDescriptor(PageDescriptor $pageDescriptor) : mixed`

##### Parameters

$pageDescriptor : PageDescriptor

##### Return values

mixed —

#### getPageDescriptor()

PageStore.php : 97

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 —

#### getPageDescriptors()

PageStore.php : 86

Gets all pages

`public getPageDescriptors() : array<string|int, PageDescriptor>`

##### Return values

array<string|int, PageDescriptor> —

#### getPageMap()

PageStore.php : 122

Gets an array of pages with and without categories.

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

##### Return values

array<string|int, string> —

#### setCategoryFaIcon()

PageStore.php : 60
`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 —

#### insertMenuLink()

PageStore.php : 165
`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