Skip to main content

Pages

Page controllers are responsible for fetching the content from a respository and rendering a template. A simple invokable controller is defined per Page class. Page controllers are invoked by a route.

Each page controller extends the Photon\Core\Controller\Page class of the PhotonCoreBundle project.

Photon\Core\Controller\Page itself extends the Symfony framework Controller class. Further details are available in the Symfony documentation - Controller.

Pages are registered within the theme services.yml configuration file.

photon_cms_project.page.document_category:
class: DocumentCategoryController
parent: photon.controller.page
arguments:
- '@photon.repository.category'
- '@photon.repository.document'
- '@photon.repository.homepage'
- '@photon.repository.homepage_category_default'
- '@photon.repository.supplement'
- '@sdk.configuration.constant_repository'
- '@router'
tags:
- { name: photon.page, page_name: document_category }

Page services must be tagged with photon.page.