Skip to content

Loading the publication

Edoardo Cavazza edited this page May 6, 2022 · 1 revision

With the term "publication" we refer to the root folder that frontend uses to collect the contents of the website.
It usually contains publisher (aka customer) informations and other helpful metadata.

The Publication component can be loaded along the Objects component in order to load root folder data:

src/Controller/AppController.php

$this->loadComponent('Chialab/FrontendKit.Publication', [
    // the uname of the root folder
    'publication' => 'root-uname'
]);

Then, you can use $this->Publication->getPublication() method to retrieve the root folder instance in your controller, as well as the publication variable in templates.

Clone this wiki locally