Tereta/Page Module

Overview

Page management module. Supports two approaches: storing pages in the database and file-based static pages. If a page is not found in the database, the module looks for it in the file system.
The file system allows easy creation and editing of pages without admin panel access, which is convenient for static sections (e.g., "About", "Contacts", etc.).
File-based pages also enable maintaining a Git repository for version control and collaboration.

Configuration

The static pages directory is specified in .config.php:

->set('page', Value::factory()->create()
    ->set('location', '%s/resources/pages'))

%s is substituted with the project root directory. Pages are organized by site: resources/pages/{site-identifier}/src/.

Static Pages

Pages are placed as .html or .phtml files:

resources/pages/site_identifier/src/
├── index.html          # Home page (/)
├── about.html          # /about
└── about/
    └── team.html       # /about/team

Metadata is specified in an HTML comment at the beginning of the file:

<!--
  @title: Page Title
  @description: Page description
  @status: enabled
  @css: /path/to/style.css
-->
<h1>Page content</h1>

A page is publicly accessible only with @status: enabled.

CLI Commands

./cli.php page:registration <site-identifier>   # Register static pages in routes (route table)

The command scans the file system, extracts metadata, and creates route records for discovered pages.

Author and License

Author: Tereta Alexander
Website: tereta.dev
License: Apache License 2.0. See LICENSE.

 www.████████╗███████╗██████╗ ███████╗████████╗ █████╗
     ╚══██╔══╝██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔══██╗
        ██║   █████╗  ██████╔╝█████╗     ██║   ███████║
        ██║   ██╔══╝  ██╔══██╗██╔══╝     ██║   ██╔══██║
        ██║   ███████╗██║  ██║███████╗   ██║   ██║  ██║
        ╚═╝   ╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝
                                                      .dev

Copyright (c) 2024-2026 Tereta Alexander