PHPackages                             kenshodigital/kirby-snippet - 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. kenshodigital/kirby-snippet

ActiveKirby-plugin[Templating &amp; Views](/categories/templating)

kenshodigital/kirby-snippet
===========================

Adds controllers to Kirby snippets.

1.0.0(2y ago)09MITPHPPHP ^8.3

Since Mar 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kenshodigital/kirby-snippet)[ Packagist](https://packagist.org/packages/kenshodigital/kirby-snippet)[ RSS](/packages/kenshodigital-kirby-snippet/feed)WikiDiscussions main Synced 2d ago

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

Snippet for Kirby
=================

[](#snippet-for-kirby)

Adds controllers to [Kirby](https://getkirby.com) snippets.

General
-------

[](#general)

Brings Kirby’s mechanism for [template controllers](https://getkirby.com/docs/guide/templates/controllers) to [snippets](https://getkirby.com/docs/guide/templates/snippets) and [blocks](https://getkirby.com/docs/guide/page-builder/block-basics#custom-block-types__custom-block-type-snippet). This provides a unified and consistent way to offload logic and prepare data for cleaner templates and snippets.

### How it works

[](#how-it-works)

The plugin uses Kirby’s [native features](https://getkirby.com/docs/reference/objects/toolkit/controller) and [extension points](https://getkirby.com/docs/reference/plugins/components/snippet). It looks for a controller whenever a snippet is called, and passes the resulting controller data to the snippet.

Since blocks are also just rendered as snippets under the hood, this works for blocks as well.

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

[](#installation)

```
composer require kenshodigital/kirby-snippet ^1.0
```

Usage
-----

[](#usage)

Snippet controllers are loaded from a `snippets` folder under the [configured root for controllers](https://getkirby.com/docs/reference/system/roots/controllers).

Just as [template controllers and templates](https://getkirby.com/docs/guide/templates/controllers#the-controllers-directory), snippet controllers are identified by the same filename as their corresponding snippets.

SnippetSnippet Controller`/site/snippets/article.php``/site/controllers/snippets/article.php``/site/snippets/blocks/video.php``/site/controllers/snippets/blocks/video.php`As usual, snippet controllers are [anonymous functions](https://getkirby.com/docs/guide/templates/controllers#creating-a-controller) that receive the [snippet data](https://getkirby.com/docs/guide/templates/snippets#passing-variables-to-snippets) as arguments and return variables as an associative array. The resulting controller data is then merged with the original snippet data, before everything is passed to the snippet.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6efc76b9774f586b05d3c0429c3458aa3c672cbba47f30069acdc6f5db28b22?d=identicon)[jensscherbl](/maintainers/jensscherbl)

---

Top Contributors

[![jensscherbl](https://avatars.githubusercontent.com/u/1640033?v=4)](https://github.com/jensscherbl "jensscherbl (1 commits)")

---

Tags

htmlkirbykirby-plugintemplating

### Embed Badge

![Health badge](/badges/kenshodigital-kirby-snippet/health.svg)

```
[![Health](https://phpackages.com/badges/kenshodigital-kirby-snippet/health.svg)](https://phpackages.com/packages/kenshodigital-kirby-snippet)
```

###  Alternatives

[getkirby/cms

The Kirby core

1.5k584.8k473](/packages/getkirby-cms)[getkirby/starterkit

Kirby Starterkit

20413.5k](/packages/getkirby-starterkit)[medienbaecker/kirby-modules

Easily add modules to your pages

895.5k1](/packages/medienbaecker-kirby-modules)[getkirby/plainkit

Kirby Plainkit

11911.7k1](/packages/getkirby-plainkit)[fabianmichael/kirby-template-attributes

Better HTML attribute handling for your snippets and templates.

238.4k1](/packages/fabianmichael-kirby-template-attributes)[getkirby/layouts

Kirby Layouts

428.4k](/packages/getkirby-layouts)

PHPackages © 2026

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