PHPackages                             gsteel/looker - 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. gsteel/looker

ActiveLibrary

gsteel/looker
=============

0.9.0(2mo ago)026.9k↓47.3%[1 issues](https://github.com/gsteel/looker/issues)[1 PRs](https://github.com/gsteel/looker/pulls)2MITPHPPHP ~8.3 || ~8.4 || ~8.5CI passing

Since Oct 25Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/gsteel/looker)[ Packagist](https://packagist.org/packages/gsteel/looker)[ RSS](/packages/gsteel-looker/feed)WikiDiscussions 0.11.x Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (24)Used By (2)

"Looker" - Another PHP HTML Templating Library
==============================================

[](#looker---another-php-html-templating-library)

[![Continuous Integration](https://github.com/gsteel/looker/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/gsteel/looker/actions/workflows/continuous-integration.yml)[![Type Coverage](https://camo.githubusercontent.com/c514477e40d63dd5d433ee894d8649c85491bba7ff5d9b4764efdce412b5e355/68747470733a2f2f73686570686572642e6465762f6769746875622f67737465656c2f6c6f6f6b65722f636f7665726167652e737667)](https://shepherd.dev/github/gsteel/looker)

This library is modelled after [laminas-view](https://github.com/laminas/laminas-view/) but has *less* functionality 🙃

It doesn't have any of the legacy associated with the MVC framework, and has a plugin manager that keeps track of stateful plugins so that they can easily be reset for each rendering cycle.

State in plugins is often unavoidable, but it's a pain in the ass in long-running processes such as Swoole and Roadrunner etc. This library attempts to make dealing with that state safer, easier and more obvious.

If you are familiar with `laminas-view`, then a lot of what's here should be familiar too.

'Looker' is in active development and won't be preserving BC until a 1.0 release.

Configuration
-------------

[](#configuration)

The primary target for this lib is a [Mezzio](https://github.com/mezzio/mezzio) application, that said, it doesn't come with any useful bindings for Laminas/Mezzio apps. For that, have a look at [gsteel/looker-mezzio](https://github.com/gsteel/looker-mezzio/).

With that out of the way, basic configuration can be found in the [Config Provider](./src/ConfigProvider.php) and you'll most likely be interested in setting up template files:

### Configuring Templates

[](#configuring-templates)

As per `laminas-view`, we have "template resolvers". 3 of them:

- `MapResolver`
- `DirectoryResolver`
- `AggregateResolver`

#### Map Resolver

[](#map-resolver)

The map resolver requires one-to-one mapping of template name to on-disk file:

```
return [
    'looker' => [
        'templates' => [
            'map' => [
                'some::template' => __DIR__ . '/some/path/to/template.phtml',
            ],
        ],
    ],
];
```

Given the above configuration, you would render the template with:

```
use Looker\Model\Model;
use Looker\Renderer\Renderer;

$model = Model::new('some::template', ['variable' => 'value']);
/** @var Renderer */
$renderer->render($model);
```

#### Directory Resolver

[](#directory-resolver)

The directory resolver iterates over the configured directories in order and attempts to find the template name provided, if necessary, appending the `defaultSuffix` when no file name extension is provided.

```
return [
    'looker' => [
        'templates' => [
            'paths' => [
                __DIR__ . '/some-directory',
                __DIR__ . '/other-directory',
            ],
            'defaultSuffix' => 'phtml',
        ],
    ],
];
```

Given the above configuration, the resolver would yield:

```
$resolver->resolve('some/template'); // __DIR__ . '/some-directory/some/template.phtml'
$resolver->resolve('something.txt'); // __DIR__ . '/some-directory/something.txt'
```

#### Aggregate Resolver

[](#aggregate-resolver)

The aggregate resolver composes multiple resolvers and iterates over each in order until it finds the first resolver that can find the given template name.

Each configured resolver must be a `\Looker\Template\Resolver` instance that can be retrieved from the DI container in use.

```
return [
    'looker' => [
        'templates' => [
            'aggregate' => [
                \Looker\Template\MapResolver::class,
                \Looker\Template\DirectoryResolver::class,
            ],
        ],
    ],
];
```

With the above configuration, first the Map resolver would be consulted and then the directory resolver.

### Documentation

[](#documentation)

Is lacking - at some point I'll get around to improving it… maybe.

### Contributing

[](#contributing)

Once you cloned the project and made your changes in a branch, please run `make qa` to ensure that all QA tools run successfully before opening a PR 👍

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.5% 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.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~17 days

Total

20

Last Release

57d ago

PHP version history (3 changes)0.1.x-devPHP ~8.2 || ~8.3 || ~8.4

0.4.0PHP ~8.3 || ~8.4

0.5.0PHP ~8.3 || ~8.4 || ~8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e0bfb8bd80623a897951de63a7655d6d43798fde65f5f9263fc7619e86b689b?d=identicon)[gsteel](/maintainers/gsteel)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (209 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (120 commits)")

---

Tags

htmlmarkupmezziophptemplate

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gsteel-looker/health.svg)

```
[![Health](https://phpackages.com/badges/gsteel-looker/health.svg)](https://phpackages.com/packages/gsteel-looker)
```

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[getkirby/cms

The Kirby core

1.5k535.5k352](/packages/getkirby-cms)[laminas/laminas-form

Validate and display simple and complex forms, casting forms to business objects and vice versa

8112.0M115](/packages/laminas-laminas-form)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/state

API Platform state interfaces

223.4M57](/packages/api-platform-state)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)

PHPackages © 2026

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