PHPackages                             jamiecressey/slim-handlebars-view - 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. [Framework](/categories/framework)
4. /
5. jamiecressey/slim-handlebars-view

ActiveLibrary[Framework](/categories/framework)

jamiecressey/slim-handlebars-view
=================================

Slim Framework 3 view helper built on top of the Handlebars templating component

0.0.2(10y ago)16391MITPHPPHP &gt;=5.5.0

Since Oct 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/JamieCressey/Slim-Handlebars-View)[ Packagist](https://packagist.org/packages/jamiecressey/slim-handlebars-view)[ Docs](http://slimframework.com)[ RSS](/packages/jamiecressey-slim-handlebars-view/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Slim Framework Handlebars View
==============================

[](#slim-framework-handlebars-view)

[![Build Status](https://camo.githubusercontent.com/c208a06ea3ecf05c41b5bfbf26c1c8bebf397e653f6b5873a5dc7716216d74cb/68747470733a2f2f7472617669732d63692e6f72672f6a616d6965637265737365792f48616e646c65626172732d566965772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jamiecressey/Handlebars-View)

This is a Slim Framework view helper built on top of the Handlebars templating component. You can use this component to create and render templates in your Slim Framework application.

Install
-------

[](#install)

Via [Composer](https://getcomposer.org/)

```
$ composer require jamiecressey/slim-handlebars-view
```

Requires Slim Framework 3 and PHP 5.5.0 or newer.

Usage
-----

[](#usage)

```
// Create Slim app
$app = new \Slim\App();

// Fetch DI Container
$container = $app->getContainer();

// Register Handlebars View helper
$container['view'] = function ($c) {
    $view = new \Slim\Views\Handlebars('path/to/templates', [
        'extension' => 'handlebars'
    ]);

    return $view;
};

// Define named route
$app->get('/hello/{name}', function ($request, $response, $args) {
    return $this->view->render($response, 'profile.html', [
        'name' => $args['name']
    ]);
})->setName('profile');

// Run app
$app->run();
```

Custom template functions
-------------------------

[](#custom-template-functions)

This component exposes a custom `path_for()` function to your Handlebars templates. You can use this function to generate complete URLs to any Slim application named route. This is an example Handlebars template:

```
{{>layout}}

User List

    Josh

```

Testing
-------

[](#testing)

```
phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jamie Cressey](https://github.com/JamieCressey)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

3923d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d11f2e76de7ba7b3ebe3df115f6e81842fb6b7f0896189c53f2116fd3f35e3c?d=identicon)[jayc89](/maintainers/jayc89)

---

Top Contributors

[![JamieCressey](https://avatars.githubusercontent.com/u/6462914?v=4)](https://github.com/JamieCressey "JamieCressey (7 commits)")

---

Tags

frameworkslimtemplateviewhandlebars

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jamiecressey-slim-handlebars-view/health.svg)

```
[![Health](https://phpackages.com/badges/jamiecressey-slim-handlebars-view/health.svg)](https://phpackages.com/packages/jamiecressey-slim-handlebars-view)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3738.7M235](/packages/slim-twig-view)[slim/php-view

Render PHP view scripts into a PSR-7 Response object.

2849.9M101](/packages/slim-php-view)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[mathmarques/smarty-view

Slim Framework 4 view helper built on top of the Smarty templating component

24136.7k1](/packages/mathmarques-smarty-view)[rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

2022.6k2](/packages/rubellum-slim-blade-view)

PHPackages © 2026

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