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
Set main properties.
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.
Details
at line 92
__construct(array $data, object $Shared)
Set main properties.
at line 108
string
__get(string $key)
Make basic data items accessible as page properties.
at line 170
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 213
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 235
string
getTemplate()
Return the template of the page.
at line 263
boolean
isCurrent()
Check if page is the current page.
at line 276
boolean
isInCurrentPath()
Check if the page URL is a part the current page's URL.