PHPackages                             fcog/fractal-handlebars-php - 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. fcog/fractal-handlebars-php

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

fcog/fractal-handlebars-php
===========================

Fractal styleguide template loader for PHP and Handlebars

1.0.4(5y ago)012MITPHPPHP &gt;=7.2

Since Aug 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Fcog/fractal-handlebars-php)[ Packagist](https://packagist.org/packages/fcog/fractal-handlebars-php)[ Docs](http://www.github.com/fcog/fractal-handlebars-php)[ RSS](/packages/fcog-fractal-handlebars-php/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Fractal styleguide template loader for PHP and Handlebars
=========================================================

[](#fractal-styleguide-template-loader-for-php-and-handlebars)

Use [Fractal Styleguide](https://fractal.build/) in your PHP project.

1. Create the component's mapping file using [Fractal's API](https://fractal.build/api/).

```
const path = require('path');
const fs = require('fs');

function exportPaths() {
    const map = {};
    for (let item of fractal.components.flatten()) {
        map[`@${item.handle}`] = path.relative(process.cwd(), item.viewPath);
    }
    fs.writeFileSync('components-map.json', JSON.stringify(map, null, 2), 'utf8');
}

fractal.components.on('updated', function(){
    exportPaths();
});

fractal.cli.command('pathmap', function(opts, done){
    exportPaths();
    done();
});
```

2. Load the renderer library.

```
$view_engine = new Renderer(
    get_template_directory() . '/component-library/',
    get_template_directory_uri() . '/component-library/assets'
);

// In some template file
$view_engine->render('@fractal-component-handle', ['data_prop' => 'value']);
```

Note: components-map.json should be in the same directory of the first argument passed to Renderer()

Credits
-------

[](#credits)

[rodger](https://github.com/rogden)

[allmarkedup](https://github.com/allmarkedup)

More info
---------

[](#more-info)

[frctl/fractal#190](https://github.com/frctl/fractal/issues/190)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Total

5

Last Release

2106d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5692863?v=4)[Francisco Giraldo](/maintainers/Fcog)[@Fcog](https://github.com/Fcog)

---

Tags

templatingmustachefractalstyleguidehandlebars

### Embed Badge

![Health badge](/badges/fcog-fractal-handlebars-php/health.svg)

```
[![Health](https://phpackages.com/badges/fcog-fractal-handlebars-php/health.svg)](https://phpackages.com/packages/fcog-fractal-handlebars-php)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[zordius/lightncandy

An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ).

60910.5M45](/packages/zordius-lightncandy)[salesforce/handlebars-php

Handlebars processor for php

80713.2k11](/packages/salesforce-handlebars-php)[voodoophp/handlebars

Handlebars processor for php

34158.9k2](/packages/voodoophp-handlebars)[pattern-lab/styleguidekit-assets-default

The assets for the default StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.

351.4M6](/packages/pattern-lab-styleguidekit-assets-default)[proai/laravel-handlebars

A Laravel wrapper for LightnCandy for using the Handlebars (and Mustache) template engine.

38204.7k](/packages/proai-laravel-handlebars)

PHPackages © 2026

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