darling / roady-ui-utilities
UI utilities for the Roady php framework.
Installs: 37
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Type:project
Requires
- php: ^8.1
- darling/php-darling-dev-tools: ^1.0
- darling/php-unit-test-utilities: ^1.0
- darling/roady-module-utilities: ^1.0
- darling/roady-routes: ^1.0
- darling/roady-routing-utilities: ^1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-27 23:17:49 UTC
README
Provides classes for the Roady
php
framework's User Interface.
Installation
composer require darling/roady-ui-utilities
Classes
\Darling\RoadyUIUtilities\classes\ui\html\UserInterface
A UserInterface can render output for a Response.
The UserInterface's defined under the
Darling\RoadyUIUtilities\interfaces\ui\html
namespace
are intended to produce html for a web page based
on the Routes defined by a given Response.
The following is a snippet from the Roady php
framework's
index.php
file showing how a UserInterface is used in
practice.
$currentRequest = new RequestInstance(); $roadyModuleFileSystemPathDeterminator = new RoadyModuleFileSystemPathDeterminatorInstance(); $router = new RouterInstance( new ListingOfDirectoryOfRoadyModulesInstance( RoadyAPI::pathToDirectoryOfRoadyModules() ), new ModuleCSSRouteDeterminatorInstance(), new ModuleJSRouteDeterminatorInstance(), new ModuleOutputRouteDeterminatorInstance(), $roadyModuleFileSystemPathDeterminator, new ModuleRoutesJsonConfigurationReaderInstance(), ); $response = $router->handleRequest($currentRequest); $roadyUI = new UserInterface( RoadyAPI::pathToDirectoryOfRoadyModules(), new RouteCollectionSorterInstance(), $roadyModuleFileSystemPathDeterminator, ); echo $roadyUI->render($response);