Skip to main content

CMSController

The CMSController is an internal server-side controller, registered by the CMSModule. It contains the handler methods for all incoming HTTP requests related to the CMS.

Available Methods

  • getPage
  • getPreviewContext

These methods are mapped to routes by the CMSRouteConfig route-config array and use the CMSService to perform the requested actions.

Usage

This is an internal framework component. You do not need to interact with it directly.


Deep Dive

Description: The CMSController is the entry point for all CMS-related network requests that arrive at your Archibald server. Its sole responsibility is to parse the incoming request (e.g., query parameters, body), call the appropriate method on the CMSService, and return the result as an HTTP response.

  • How To: As an internal component, you don't interact with it directly. However, knowing it exists helps in understanding the server-side flow. When your client-side CMSAdapter makes a call to /api/cms/pages, it's the CMSController's getPage method that receives and handles that request.

  • Best Practice: Do not attempt to override or extend this controller. It is designed to be a thin, generic layer. If you need to add custom server-side logic or new CMS-related endpoints, the correct approach is to create a new, separate module with its own controllers and services, rather than modifying the built-in CMSModule components. This ensures your application remains compatible with future framework updates.