Methods

__construct()

__construct(string  $block, string  $key, string  $title) : mixed

Constructor.

Parameters

string $block

Navigation block

string $key
string $title

Throws

\InvalidArgumentException

Returns

mixed —

getKey()

getKey() : string

Returns the page key.

Returns

string —

getFullKey()

getFullKey() : string

Returns the full page path.

Returns

string —

getTitle()

getTitle() : mixed

Returns the title.

Returns

mixed —

setPopup()

setPopup(bool|string  $popup) : $this

Sets whether the page is a popup page.

The method adds (or removes) also the rex-popup CSS class and sets hasNavigation to false (true). If $popup is a string, the variable will be used for the onclick attribute.

Parameters

bool|string $popup

Returns

$this —

isPopup()

isPopup() : bool

Returns whether the page is a popup.

Returns

bool —

setHref()

setHref(string|array  $href) : $this

Sets the page href.

Parameters

string|array $href

Href string or array of params

Returns

$this —

hasHref()

hasHref() : bool

Returns whether the page has a custom href.

Returns

bool —

getHref()

getHref() : string

Returns the page href.

Returns

string —

setItemAttr()

setItemAttr(string  $name, string  $value) : $this

Sets an item attribute.

Parameters

string $name
string $value

Throws

\InvalidArgumentException

Returns

$this —

getItemAttr()

getItemAttr(string|null  $name, string  $default = '') : string|array

Returns an item attribute or all item attributes.

Parameters

string|null $name
string $default

Returns

string|array —

Attribute value for given $name or attribute array if $name is null

removeItemAttr()

removeItemAttr(string  $name) : mixed

Removes an item attribute.

Parameters

string $name

Returns

mixed —

addItemClass()

addItemClass(string  $class) : $this

Adds an item class.

Parameters

string $class

Throws

\InvalidArgumentException

Returns

$this —

removeItemClass()

removeItemClass(string  $class) : mixed

Removes an item class.

Parameters

string $class

Returns

mixed —

setLinkAttr()

setLinkAttr(string  $name, string  $value) : $this

Sets an link attribute.

Parameters

string $name
string $value

Throws

\InvalidArgumentException

Returns

$this —

removeLinkAttr()

removeLinkAttr(string  $name) : mixed

Removes an link attribute.

Parameters

string $name

Returns

mixed —

getLinkAttr()

getLinkAttr(string|null  $name, string  $default = '') : string|array

Returns an link attribute or all link attributes.

Parameters

string|null $name
string $default

Returns

string|array —

Attribute value for given $name or attribute array if $name is null

addLinkClass()

addLinkClass(string  $class) : $this

Adds an link class.

Parameters

string $class

Throws

\InvalidArgumentException

Returns

$this —

removeLinkClass()

removeLinkClass(string  $class) : mixed

Removes an link class.

Parameters

string $class

Returns

mixed —

setPath()

setPath(string  $path) : $this

Set the page path which will be included directly by the core.

Parameters

string $path

Returns

$this —

hasPath()

hasPath() : bool

Returns whether a path is set.

Returns

bool —

getPath()

getPath() : string|null

Returns the path which will be included directly by the core.

Returns

string|null —

setSubPath()

setSubPath(string  $subPath) : $this

Set the page subpath which should be used by the packages to include this page inside their main page.

Parameters

string $subPath

Returns

$this —

hasSubPath()

hasSubPath() : bool

Returns whether a subpath is set.

Returns

bool —

getSubPath()

getSubPath() : string

Returns the subpath which should by used by packages to include this page inside their main page.

Returns

string —

addSubpage()

addSubpage(self  $subpage) : $this

Adds a subpage.

Parameters

self $subpage

Returns

$this —

setSubpages()

setSubpages(self[]  $subpages) : $this

Sets all subpages.

Parameters

self[] $subpages

Returns

$this —

getSubpage()

getSubpage(string  $key) : self|null

Returns the subpage for the given key.

Parameters

string $key

Returns

self|null —

getSubpages()

getSubpages() : self[]

Returns all subpages.

Returns

self[] —

getFirstSubpagesLeaf()

getFirstSubpagesLeaf() : self

Returns the first leaf of the subpages tree.

Returns

self —

setIsActive()

setIsActive(bool  $isActive = true) : $this

Sets whether the page is active.

Parameters

bool $isActive

Returns

$this —

isActive()

isActive() : bool

Returns whether the page is active.

Returns

bool —

getParent()

getParent() : self|null

Returns the parent page object.

Returns

self|null —

setHidden()

setHidden(bool  $hidden = true) : $this

Sets whether the page is hidden.

Parameters

bool $hidden

Returns

$this —

isHidden()

isHidden() : bool

Returns whether the page is hidden.

Returns

bool —

setHasLayout()

setHasLayout(bool  $hasLayout) : $this

Sets whether the page has layout.

Parameters

bool $hasLayout

Returns

$this —

hasLayout()

hasLayout() : bool

Returns whether tha page has layout.

Returns

bool —

setHasNavigation()

setHasNavigation(bool  $hasNavigation) : $this

Sets whether the page has a navigation.

Parameters

bool $hasNavigation

Returns

$this —

hasNavigation()

hasNavigation() : bool

Returns whether the page has a navigation.

Returns

bool —

setPjax()

setPjax(bool  $pjax = true) : $this

Sets whether the page allows pjax.

Parameters

bool $pjax

Returns

$this —

allowsPjax()

allowsPjax() : bool

Returns whether the page allows pjax.

Returns

bool —

setIcon()

setIcon(string  $icon) : $this

Sets whether the page has an icon.

Parameters

string $icon

Returns

$this —

getIcon()

getIcon() : mixed

Returns the icon.

Returns

mixed —

hasIcon()

hasIcon() : bool

Returns whether the page has an icon.

Returns

bool —

setRequiredPermissions()

setRequiredPermissions(array|string  $perm) : $this

Sets the required permissions.

Parameters

array|string $perm

Returns

$this —

getRequiredPermissions()

getRequiredPermissions() : array

Returns the required permission.

Returns

array —

checkPermission()

checkPermission(\rex_user  $user) : bool

Checks whether the given user has permission for the page.

Parameters

\rex_user $user

Returns

bool —

setBlock()

setBlock(string  $block) : $this

Sets the navigation block.

Parameters

string $block

Returns

$this —

getBlock()

getBlock() : string

Returns the navigation block.

Returns

string —

setPrio()

setPrio(int  $prio) : $this

Sets the priority.

Parameters

int $prio

Returns

$this —

getPrio()

getPrio() : int

Returns the priority.

Returns

int —