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. [Templating &amp; Views](/categories/templating)
4. /
5. gsteel/looker

ActiveLibrary[Templating &amp; Views](/categories/templating)

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

0.11.0(1mo ago)030.8k—4.5%[1 issues](https://github.com/gsteel/looker/issues)[1 PRs](https://github.com/gsteel/looker/pulls)2MITPHPPHP ~8.4 || ~8.5CI passing

Since Oct 25Pushed 3d ago2 watchersCompare

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

READMEChangelog (10)Dependencies (36)Versions (32)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

52

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity58

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 ~26 days

Total

24

Last Release

5d ago

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

0.4.0PHP ~8.3 || ~8.4

0.5.x-devPHP ~8.3 || ~8.4 || ~8.5

0.10.0PHP ~8.4 || ~8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2803720?v=4)[George Steel](/maintainers/gsteel)[@gsteel](https://github.com/gsteel)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (223 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (128 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

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/dependency-injection

Allows you to standardize and centralize the way objects are constructed in your application

4.2k455.6M9.6k](/packages/symfony-dependency-injection)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7528.4M269](/packages/laminas-laminas-view)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k53](/packages/ecotone-ecotone)

PHPackages © 2026

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