Main component

Servant's functionality is divided into bite-sized objects. The most important one one of these is ServantMain.


When writing dynamic pages, templates or Actions, the Main component is available as $servant. The following services are avialable for it.

Property name Description
available() Lists of available items in the system.
create() An object factory for generating components nicely.
constants() System-wide constants, such as defaults and file type mappings.
debug() Tells if if debug mode is on. true or false
files() File reading service. This is used to read various templating formats.
paths() Internal paths in various formats.
sitemap() Site's pages & categories in a tree, with traversing functions for many use cases.
utilities() Access to external PHP libraries and autoloaders.
warnings() Any warnings generated by Servant, about missing files or malformatted settings.