PHPackages                             alxarafe/resource-html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. alxarafe/resource-html

Abandoned → [alxarafe/resource-controller](/?search=alxarafe%2Fresource-controller)Library[Templating &amp; Views](/categories/templating)

alxarafe/resource-html
======================

HTML adapter for alxarafe/resource-controller. Provides a RendererContract implementation using pure PHP and HTML templates.

0.1.0(1mo ago)012GPL-3.0-or-laterPHPPHP ^8.2CI passing

Since Apr 23Pushed 1mo agoCompare

[ Source](https://github.com/alxarafe/resource-html)[ Packagist](https://packagist.org/packages/alxarafe/resource-html)[ RSS](/packages/alxarafe-resource-html/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

alxarafe/resource-html
======================

[](#alxaraferesource-html)

Warning

**DEPRECATED AND OBSOLETE**

This package has been deprecated and its functionality has been natively integrated into [**resource-controller**](https://github.com/alxarafe/resource-controller) via the `DefaultRenderer` and static HTML templates. You no longer need this package. Please remove it from your dependencies.

[![PHP Version](https://camo.githubusercontent.com/0850ed948ac3ac730f3c66764c4e21ea1163f0b76bf9624c97c8c0be7af8f050/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c756576696f6c65743f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0850ed948ac3ac730f3c66764c4e21ea1163f0b76bf9624c97c8c0be7af8f050/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c756576696f6c65743f7374796c653d666c61742d737175617265)[![CI](https://github.com/alxarafe/resource-html/actions/workflows/ci.yml/badge.svg)](https://github.com/alxarafe/resource-html/actions/workflows/ci.yml/badge.svg)[![Tests](https://github.com/alxarafe/resource-html/actions/workflows/tests.yml/badge.svg)](https://github.com/alxarafe/resource-html/actions/workflows/tests.yml/badge.svg)[![Static Analysis](https://camo.githubusercontent.com/949a823ae3b18f7450026518eb003044528051afb988a983a5b9d5f64cf48f40/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461746963253230616e616c797369732d5048505374616e2532302532422532305073616c6d2d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/949a823ae3b18f7450026518eb003044528051afb988a983a5b9d5f64cf48f40/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f737461746963253230616e616c797369732d5048505374616e2532302532422532305073616c6d2d626c75653f7374796c653d666c61742d737175617265)[![PRs Welcome](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)](https://github.com/alxarafe/resource-html/issues)

**HTML adapter for alxarafe/resource-controller.**

Provides a `RendererContract` implementation using pure PHP and HTML templates (`.phtml` or `.php`).

Ecosystem
---------

[](#ecosystem)

PackagePurposeStatus**[resource-controller](https://github.com/alxarafe/resource-controller)**Core CRUD engine + UI components✅ Stable**[resource-eloquent](https://github.com/alxarafe/resource-eloquent)**Eloquent ORM adapter✅ Stable**[resource-pdo](https://github.com/alxarafe/resource-pdo)**Native PDO adapter✅ Stable**[resource-blade](https://github.com/alxarafe/resource-blade)**Blade template renderer adapter✅ Stable**[resource-twig](https://github.com/alxarafe/resource-twig)**Twig template renderer adapter✅ Stable**[resource-html](https://github.com/alxarafe/resource-html)**Pure PHP/HTML template renderer adapter✅ StableInstallation
------------

[](#installation)

```
composer require alxarafe/resource-html
```

This will also install `alxarafe/resource-controller` as a dependency.

Usage
-----

[](#usage)

```
use Alxarafe\ResourceHtml\HtmlRenderer;

// Create a renderer with template paths
$renderer = new HtmlRenderer(
    templatePaths: [__DIR__ . '/views']
);

// Render a template (automatically resolves .phtml or .php)
echo $renderer->render('products/index', [
    'title' => 'Products',
    'items' => $products,
]);

// Add additional template paths at runtime
$renderer->addTemplatePath(__DIR__ . '/module-views');
```

### Template example (`views/products/index.phtml`)

[](#template-example-viewsproductsindexphtml)

```
