jdwx/web-pages

Installs: 7

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/jdwx/web-pages

v1.0.0 2025-11-28 04:06 UTC

This package is auto-updated.

Last update: 2025-11-28 04:52:05 UTC


README

PHP module for building up simple pages (e.g., for error messages)

Installation

You can require it directly with Composer:

composer require jdwx/web-pages

Or download the source from GitHub: https://github.com/jdwx/web-pages-php.git

Requirements

This module requires PHP 8.3 or later.

Usage

This module provides simplified ways to build various types of responses. It's mostly used for error pages or other places where a full application context may not be available or appropriate.

Here's a simple example:

$page = new SimpleHtmlPage();
$page->setTitle( 'Example Page' );
$page->addContent( '<p>This is an example page.</p>' );
echo $page;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>Example Page</title>
    <meta charset="UTF-8">
</head>
<body><p>This is an example page.</p></body>
</html>

(It won't be formatted quite like this because the editor for this file automatically reformats.)

Stability

This module is considered stable and is extensively used in production code, but in relatively low volume due to the nature of the functionality it provides.

The module has complete test coverage.

History

This module was refactored out of the jdwx/web-php module in November 2025.