ParsesLinkIndex
in package
Parse the linkIndex.yml file which is used to determine the order the MarkdownPageCollection::class collection for pages in the sidebar.
Table of Contents
- $filePath : string
- Path where the index is stored.
- $index : array<string|int, mixed>
- The created Index array where the key is the numerical index and the value is the slug.
- __construct() : mixed
- Construct the class
- findIndexOfSlug() : int|false
- Get the index of a slug.
- getIndexOfSlug() : int|false
- Static shorthand to get the index from a slag.
- parseYamlToArray() : array<string|int, mixed>
- Stupidly simple and fast YAML list parser
Properties
$filePath
Path where the index is stored.
private
string
$filePath
Usually
$index
The created Index array where the key is the numerical index and the value is the slug.
private
array<string|int, mixed>
$index
Methods
__construct()
Construct the class
public
__construct() : mixed
Tags
Return values
mixed —findIndexOfSlug()
Get the index of a slug.
public
findIndexOfSlug(string $slug[, int|bool $default = false ]) : int|false
Optionally specify the return value if a slug does not exist in the linkIndex.yml
Parameters
- $slug : string
-
to search
- $default : int|bool = false
-
return value
Return values
int|false —returns found value, or the fallback
getIndexOfSlug()
Static shorthand to get the index from a slag.
public
static getIndexOfSlug(string $slug[, int|bool $default = false ]) : int|false
Parameters
- $slug : string
-
to search
- $default : int|bool = false
-
return value if the slug does not exist in the index
Return values
int|false —parseYamlToArray()
Stupidly simple and fast YAML list parser
public
parseYamlToArray() : array<string|int, mixed>