PHPackages                             alxarafe/resource-twig - 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-twig

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

alxarafe/resource-twig
======================

Twig adapter for alxarafe/resource-controller. Provides a RendererContract implementation using Twig for flexible and decoupled template rendering.

00PHPCI passing

Since Apr 24Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

alxarafe/resource-twig
======================

[](#alxaraferesource-twig)

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-twig/actions/workflows/ci.yml/badge.svg)](https://github.com/alxarafe/resource-twig/actions/workflows/ci.yml/badge.svg)[![Tests](https://github.com/alxarafe/resource-twig/actions/workflows/tests.yml/badge.svg)](https://github.com/alxarafe/resource-twig/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-twig/issues)

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

Provides a `RendererContract` implementation using Twig for flexible and decoupled template rendering.

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-blade](https://github.com/alxarafe/resource-blade)**Blade template renderer adapter✅ Stable**[resource-twig](https://github.com/alxarafe/resource-twig)**Twig template renderer adapter✅ StableInstallation
------------

[](#installation)

```
composer require alxarafe/resource-twig
```

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

Usage
-----

[](#usage)

```
use Alxarafe\ResourceTwig\TwigRenderer;

// Create a renderer with template paths
$renderer = new TwigRenderer(
    templatePaths: [__DIR__ . '/templates'],
    cachePath: __DIR__ . '/cache/twig',    // false to disable caching
    debug: false
);

// Render a template (auto-appends .html.twig if no extension)
echo $renderer->render('products/index', [
    'title' => 'Products',
    'items' => $products,
]);

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

### Template example

[](#template-example)

```
{# templates/products/index.html.twig #}
{{ title }}

{% for item in items %}
    {{ item.name }} — {{ item.price }}
{% endfor %}

```

Development
-----------

[](#development)

### Docker

[](#docker)

```
docker compose up -d
docker exec alxarafe-resources composer install
```

### Running the CI pipeline locally

[](#running-the-ci-pipeline-locally)

```
bash bin/ci_local.sh
```

### Running tests only

[](#running-tests-only)

```
bash bin/run_tests.sh
```

License
-------

[](#license)

GPL-3.0-or-later

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c3ef5787a3dd8f75636a6ab83a70d752c7f3f6cb71fe8e8b630e93b85ccd081?d=identicon)[rsanjoseo](/maintainers/rsanjoseo)

---

Top Contributors

[![rsanjoseo](https://avatars.githubusercontent.com/u/27363683?v=4)](https://github.com/rsanjoseo "rsanjoseo (3 commits)")

### Embed Badge

![Health badge](/badges/alxarafe-resource-twig/health.svg)

```
[![Health](https://phpackages.com/badges/alxarafe-resource-twig/health.svg)](https://phpackages.com/packages/alxarafe-resource-twig)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[wmde/php-vuejs-templating

PHP implementation of Vue.js templating engine

3041.6k2](/packages/wmde-php-vuejs-templating)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
