NavigationDataFactory
extends PageDataFactory
in package
implements
NavigationSchema
Discover data used for navigation menus and the documentation sidebar.
Table of Contents
Interfaces
- NavigationSchema
- Front matter schema interfaces are used by various Hyde components to specify what data they provide or contain. They also serve as a convenient way to see the supported front matter properties.
Constants
- SCHEMA = \Hyde\Markdown\Contracts\FrontMatter\SubSchemas\NavigationSchema::NAVIGATION_SCHEMA
- The front matter properties supported by this factory.
- CONFIG_OFFSET = 500
- FALLBACK_PRIORITY = 999
Properties
- $group : string|null
- $hidden : bool|null
- $label : string|null
- $priority : int|null
- $identifier : string
- $matter : FrontMatter
- $pageClass : string
- $routeKey : string
- $title : string
Methods
- __construct() : mixed
- toArray() : array{label: string|null, group: string|null, hidden: bool|null, priority: int|null}
- Get the generated data as an associative array.
- getMatter() : string|null|int|bool
- getSubdirectoryConfiguration() : string
- invert() : bool|null
- isInstanceOf() : bool
- makeGroup() : string|null
- makeHidden() : bool
- makeLabel() : string|null
- makePriority() : int
- offset() : int|null
- canUseSubdirectoryForGroups() : bool
- defaultGroup() : string|null
- getSubdirectoryName() : string
- isNonDocumentationPageInHiddenSubdirectory() : bool
- isPageHiddenInNavigationConfiguration() : bool
- pageIsInSubdirectory() : bool
- parseNavigationPriorityConfig() : int|null
- searchForGroupInFrontMatter() : string|null
- searchForHiddenInFrontMatter() : bool|null
- searchForLabelInConfig() : string|null
- searchForLabelInFrontMatter() : string|null
- searchForPriorityInConfigs() : int|null
- searchForPriorityInFrontMatter() : int|null
- searchForPriorityInNavigationConfig() : int|null
- searchForPriorityInSidebarConfig() : int|null
Constants
SCHEMA
The front matter properties supported by this factory.
public
final array<string, string|array<string|int, mixed>>
SCHEMA
= \Hyde\Markdown\Contracts\FrontMatter\SubSchemas\NavigationSchema::NAVIGATION_SCHEMA
Note that this represents a sub-schema, and is used as part of the page schema.
CONFIG_OFFSET
protected
mixed
CONFIG_OFFSET
= 500
FALLBACK_PRIORITY
protected
mixed
FALLBACK_PRIORITY
= 999
Properties
$group read-only
protected
string|null
$group
$hidden read-only
protected
bool|null
$hidden
$label read-only
protected
string|null
$label
$priority read-only
protected
int|null
$priority
$identifier read-only
private
string
$identifier
$matter read-only
private
FrontMatter
$matter
$pageClass read-only
private
string
$pageClass
$routeKey read-only
private
string
$routeKey
$title read-only
private
string
$title
Methods
__construct()
public
__construct(CoreDataObject $pageData, string $title) : mixed
Parameters
- $pageData : CoreDataObject
- $title : string
toArray()
Get the generated data as an associative array.
public
toArray() : array{label: string|null, group: string|null, hidden: bool|null, priority: int|null}
Return values
array{label: string|null, group: string|null, hidden: bool|null, priority: int|null}getMatter()
protected
getMatter(string $key) : string|null|int|bool
Parameters
- $key : string
Return values
string|null|int|boolgetSubdirectoryConfiguration()
protected
getSubdirectoryConfiguration() : string
Return values
stringinvert()
protected
invert(bool|null $value) : bool|null
Parameters
- $value : bool|null
Return values
bool|nullisInstanceOf()
protected
isInstanceOf(HydePage> $class) : bool
Parameters
- $class : HydePage>
Return values
boolmakeGroup()
protected
makeGroup() : string|null
Return values
string|nullmakeHidden()
protected
makeHidden() : bool
Return values
boolmakeLabel()
protected
makeLabel() : string|null
Return values
string|nullmakePriority()
protected
makePriority() : int
Return values
intoffset()
protected
offset(int|null $value, int $offset) : int|null
Parameters
- $value : int|null
- $offset : int
Return values
int|nullcanUseSubdirectoryForGroups()
private
canUseSubdirectoryForGroups() : bool
Return values
booldefaultGroup()
private
defaultGroup() : string|null
Return values
string|nullgetSubdirectoryName()
private
getSubdirectoryName() : string
Return values
stringisNonDocumentationPageInHiddenSubdirectory()
private
isNonDocumentationPageInHiddenSubdirectory() : bool
Return values
boolisPageHiddenInNavigationConfiguration()
private
isPageHiddenInNavigationConfiguration() : bool
Return values
boolpageIsInSubdirectory()
private
pageIsInSubdirectory() : bool
Return values
boolparseNavigationPriorityConfig()
private
parseNavigationPriorityConfig(array<string, int>|array<string|int, string> $config, "routeKey"|"identifier" $pageKeyName) : int|null
Parameters
- $config : array<string, int>|array<string|int, string>
- $pageKeyName : "routeKey"|"identifier"
Return values
int|nullsearchForGroupInFrontMatter()
private
searchForGroupInFrontMatter() : string|null
Return values
string|nullsearchForHiddenInFrontMatter()
private
searchForHiddenInFrontMatter() : bool|null
Return values
bool|nullsearchForLabelInConfig()
private
searchForLabelInConfig() : string|null
Return values
string|nullsearchForLabelInFrontMatter()
private
searchForLabelInFrontMatter() : string|null
Return values
string|nullsearchForPriorityInConfigs()
private
searchForPriorityInConfigs() : int|null
Return values
int|nullsearchForPriorityInFrontMatter()
private
searchForPriorityInFrontMatter() : int|null
Return values
int|nullsearchForPriorityInNavigationConfig()
private
searchForPriorityInNavigationConfig() : int|null
Return values
int|nullsearchForPriorityInSidebarConfig()
private
searchForPriorityInSidebarConfig() : int|null