Page
class Page (View source)
The Page class holds all properties and methods of a single page.
A Page object describes an entry in the collection of all pages in the Automad class. Basically the Automad object consists of many Page objects.
Properties
$data | The $data array holds all the information stored as "key: value" in the text file and some other system generated information (:path, :level, :template . | ||
$Shared | The Shared data object. | ||
$tags | The $tags get also extracted from the text file (see $data). |
Methods
Make basic data items accessible as page properties.
Return requested data - from the page data array, from the shared data array or as generated system variable.
Get the modification time/date of the page.
Return the template of the page.
Check if page is the current page.
Check if the page URL is a part the current page's URL.
Extracts the tags string out of a given array and returns an array with these tags.
Details
at line 91
string
__get(string $key)
Make basic data items accessible as page properties.
at line 123
string
get(string $key)
Return requested data - from the page data array, from the shared data array or as generated system variable.
The local page data array gets used as first and the shared data array gets used as second source for the requested variable. That way it is possible to override a shared data value on a per page basis. Note that not all data is stored in the data arrays. Some data (:mtime, :basename ...) should only be generated when requested out of performance reasons.
at line 155
string
getMtime()
Get the modification time/date of the page.
To determine to correct mtime, the page directory mtime (to check if any files got added) and the page data file mtime will be checked and the highest value will be returned.
at line 173
string
getTemplate()
Return the template of the page.
at line 193
bool
isCurrent()
Check if page is the current page.
at line 202
bool
isInCurrentPath()
Check if the page URL is a part the current page's URL.
at line 217
private array
extractTags()
Extracts the tags string out of a given array and returns an array with these tags.