Search by

Reusable public CMS route runtime for Lemonade.

Package info

github.com/johnnyxlemonade/cms-core

pkg:composer/johnnyxlemonade/cms-core

Statistics

Installs: 1 265

Dependents: 6

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-12-03 13:38 UTC

This package is auto-updated.

Last update: 2026-12-03 13:39:33 UTC


README

Tests PHP 8.3–8.6 PHPStan License

CMS Core provides the shared content lifecycle, canonical URLs and locale-aware public routing for Lemonade CMS modules. The host supplies public handlers and renders the responses.

Features

  • Locale resolution, canonical route reservation and request-scoped lookup.
  • Shared draft, publication, ownership and audit lifecycle.
  • Reusable editor reads and publication scopes for content modules.

Requirements

  • PHP 8.3 or newer, tested on PHP 8.3–8.6.
  • Lemonade Framework ^1.0.

Installation

composer require johnnyxlemonade/cms-core:^1.0

Register CmsCoreServiceProvider and bind PublicLocaleRegistryInterface and PublicModuleStateResolverInterface in the host. Run the host migrations to create the canonical route index.

Public routing

Register a PublicCmsRouteHandlerInterface for each module the host renders. The route resolver checks the locale, canonical path and module availability. The handler checks whether the localized record is public. PublicCmsRouteResolver::currentRoute() shares the canonical lookup with dispatch.

Module integration

CmsContentDefinition configures the root table, translations and localized paths. Use rootScope() for a partition in a shared root table.

$moduleCode = $definition->getModuleCode();
$rootTable = $definition->getRootTable();
$hasBody = $definition->hasBodyColumns();
$pathPrefix = $definition->routePrefix('cs');
  • CmsContentReadModel supplies editor reads, owner lookup, translations and tag suggestions. Domain columns come from CmsRoot and CmsLocalized attributes.
  • PublishedContentScope supplies the shared publication query and canonical language alternatives for routed content.
  • PublishedContentInterface gives host renderers one contract for identity, title, locale, canonical URL and SEO across CMS Page, Content Types and News.
  • PublishedPresentation exposes editorial display settings and calculates reading time for Content Types and News. Host views choose how to render those values.
  • CmsContentValueWriter lets a module validate and save its own field values in the existing lifecycle transaction.

Development

composer install
composer qa

License

Apache License 2.0