KoniKode · Software built with intention

KNOWLEDGE BASE

Documentation

DOCUMENTATION
CURRENT APPLICATIONClean Framework
DocumentationClean Framework

Clean Framework · DOCUMENTATION

Source: ReadingListController.php

Source: ReadingListController.php

Bounded candidate reference — 2026-10-20: 0.2.0-rc.1 is committed locally through 84f415b3098af5653577b2c65eea31fca21df79c, unpublished and not production-approved; stable PHP >=8.5.11 <8.6.0 is required. This is documentation, not adoption: this knowledge base retains its installed 0.1.0-rc.1 dependency and PHP 8.2.11 local profile. Dated PHP 8.2 evidence is historical; earlier dirty-source reports retain their original test provenance, not retroactive clean-commit proof. Candidate examples are illustrative: API signatures were reviewed, but candidate code was not executed by this editorial update. See current checkpoint, open criteria and adoption boundary.

Origin: examples/reading-list/app/Controllers/ReadingListController.php

<?php

declare(strict_types=1);

namespace Portability\ReadingList\Controllers;

use Clean\Framework\Error\HttpException;
use Clean\Framework\Http\Request;
use Clean\Framework\Http\Response;
use Clean\Framework\View\ViewFactory;
use Portability\ReadingList\Services\BrowseReadingList;

/** Thin HTTP adapter for the reading-list browsing use case. */
final class ReadingListController
{
    /** Inject the application use case and framework presentation boundary. */
    public function __construct(
        private BrowseReadingList $readingList,
        private ViewFactory $views
    ) {
    }

    /** Render the complete reading list without performing persistence work. */
    public function index(Request $request): Response
    {
        return Response::html($this->views->render('layouts/main.php', [
            'title' => 'Reading List',
            'content_view' => 'pages/index.php',
            'items' => $this->readingList->all(),
        ]));
    }

    /**
     * Render one exact route-constrained entry or a safe not-found response.
     *
     * @param array<string,mixed> $parameters
     */
    public function show(Request $request, array $parameters): Response
    {
        $item = $this->readingList->find((string) ($parameters['slug'] ?? ''));
        if ($item === null) {
            throw new HttpException(404, 'The reading-list entry was not found.');
        }
        return Response::html($this->views->render('layouts/main.php', [
            'title' => $item['title'],
            'content_view' => 'pages/detail.php',
            'item' => $item,
        ]));
    }
}

Editorial provenance

Source: examples/reading-list/app/Controllers/ReadingListController.php. Source SHA-256: 06d0ec016c173d3cd3ad111df95108cd166e0a52b811faf4c5e848a259553bc6.

Framework candidate reference; editorial checkpoint 2026-10-20. See candidate status and adoption boundary.

EXPLORE FURTHER

Drag a divider or use Left and Right Arrow keys to resize. Hold Shift for larger steps. Enter hides or restores the sidebar; Home and End select its minimum or maximum width. Double-click resets the width.

Install KoniKode