PHPackages                             smalldb/template-sloth - 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. smalldb/template-sloth

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

smalldb/template-sloth
======================

Slot-based template extension

1181PHP

Since Feb 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/smalldb/template-sloth)[ Packagist](https://packagist.org/packages/smalldb/template-sloth)[ RSS](/packages/smalldb-template-sloth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Template Sloth
==============

[](#template-sloth)

Slot-based template extension.

See

...

Installation
------------

[](#installation)

Using Composer:

```
composer require smalldb/template-sloth

```

Symfony's `config.yml` — add `sloth` service, it will register into Twig automatically:

```
services:
        sloth:
                class: Smalldb\TemplateSloth\Sloth
                arguments: [ '@twig' ]
```

Troubleshooting
---------------

[](#troubleshooting)

> Error: Unexpected "slot" tag (expecting closing tag for the "…" tag defined near line …) in …

This means the Sloth did not install the Twig extension. Is your dependency injection container configured properly?

Usage
-----

[](#usage)

```
$sloth = $this->get('sloth');
$sloth->setLayout('layout.html.twig', [ 'user' => 'Alice']);
$sloth->slot('content')->add(10, 'template.html.twig', [ 'foo' => 'bar' ];
$sloth->slot('content')->add(20, 'template.html.twig', [ 'foo' => 'foo' ];
return $sloth->response();
```

```
{% if 'content' is empty_slot %}
  No content available.
{% else %}
  {% slot 'content' %}
{% endif %}
```

Documentation
-------------

[](#documentation)

See

License
-------

[](#license)

The most of the code is published under Apache 2.0 license. See [LICENSE](Resources/doc/license.md) file for details.

Contribution guidelines
-----------------------

[](#contribution-guidelines)

Project's primary repository is hosted at , feel free to submit issues there or create merge requests.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

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/c470eb17bb351ae00fe3595f251ec35b14f1b064391952c2cb1c7bea445b73a9?d=identicon)[jkufner](/maintainers/jkufner)

---

Top Contributors

[![jkufner](https://avatars.githubusercontent.com/u/16572?v=4)](https://github.com/jkufner "jkufner (24 commits)")

---

Tags

compositionregionsslotslotstwig-extension

### Embed Badge

![Health badge](/badges/smalldb-template-sloth/health.svg)

```
[![Health](https://phpackages.com/badges/smalldb-template-sloth/health.svg)](https://phpackages.com/packages/smalldb-template-sloth)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M290](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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