Skip to content

Kirby's PHP API

Kirby has a mighty PHP API, which you can use in your snippets, templates, controllers and plugins to access each and every bit and piece of data and aspect of your site and system.


The $site object represents the root of your site with all the information stored in /content/site.txt.

Learn more about $site ›


The $pages object contains the first level of pages. It can be used to build the main menu or dive deeper into the structure of your site.

Learn more about $pages ›


The $page object represents the currently active page. It gives you access to the page's data, attached files, subpages and more.

Learn more about $page ›


The $kirby class is the heart and soul of Kirby. It's the access point for registered users, the current request, route, plugins and more.

Learn more about $kirby ›