Automad
class Automad (View source)
The Automad class includes all methods and properties regarding the site, structure and pages.
A Automad object is the "main" object. It consists of many single Page objects, the Shared object and holds also additional data like the Filelist and Pagelist objects.
Properties
$Context | Automad's Context object. | ||
$Shared | Automad's Shared object. |
Methods
Parse sitewide settings, create $collection and set the context to the currently requested page.
Define properties to be cached.
Set new Context after being restored from cache.
Return $collection array.
If existing, return the page object for the passed relative URL.
Return Automad's instance of the Filelist class and create instance when accessed for the first time.
Return Automad's instance of the Pagelist class and create instance when accessed for the first time.
Tests wheter the currently requested page actually exists and is not an error page.
Load and buffer a template file and return its content as string. The Automad object gets passed as parameter to be available for all plain PHP within the included file.
Details
at line 276
__construct()
Parse sitewide settings, create $collection and set the context to the currently requested page.
at line 296
array
__sleep()
Define properties to be cached.
at line 308
__wakeup()
Set new Context after being restored from cache.
at line 322
array
getCollection()
Return $collection array.
at line 336
object
getPage(string $url)
If existing, return the page object for the passed relative URL.
at line 394
object
getFilelist()
Return Automad's instance of the Filelist class and create instance when accessed for the first time.
at line 411
object
getPagelist()
Return Automad's instance of the Pagelist class and create instance when accessed for the first time.
at line 428
boolean
currentPageExists()
Tests wheter the currently requested page actually exists and is not an error page.
at line 450
string
loadTemplate(string $file)
Load and buffer a template file and return its content as string. The Automad object gets passed as parameter to be available for all plain PHP within the included file.
This is basically the base method to load a template without parsing the Automad markup. It just gets the parsed PHP content.
Before returning the markup, all comments <# ... #> get stripped.
Note that even when the it is possible to use plain PHP in a template file, all that code will be parsed first when buffering, before any of the Automad markup is getting parsed. That also means, that is not possible to make plain PHP code really interact with any of the Automad placeholder markup.