PHPackages                             afbora/kirby-blade - 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. afbora/kirby-blade

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

afbora/kirby-blade
==================

Enable Laravel Blade Template Engine for Kirby 3

1.9.2(4y ago)214112[6 issues](https://github.com/afbora/kirby-blade/issues)MITPHPPHP ^7.3|^8.0

Since Jun 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/afbora/kirby-blade)[ Packagist](https://packagist.org/packages/afbora/kirby-blade)[ Fund](https://a.paddle.com/v2/click/1129/52467?link=1170)[ RSS](/packages/afbora-kirby-blade/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (19)Used By (0)

Kirby Blade
===========

[](#kirby-blade)

Update: 27 June 2022

There is now an official fork of Laravel Blade:

---

[![Source](https://camo.githubusercontent.com/a4f1688df992955444633e3934abc7d89d3d31bc4473e0ecb939e8be71708c55/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d6166626f72612f6b697262792d2d626c6164652d626c75653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)[![Download](https://camo.githubusercontent.com/be92f0ad050435727613baffd41b7390f4e6cfe0a7f727ee5386a7f9fdadbc60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6166626f72612f6b697262792d626c6164653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)[![Open Issues](https://camo.githubusercontent.com/43d2fdac92c17682b6e34c307abeccf83e71b6a290da6690723a4e7a8bcc23c6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f6166626f72612f6b697262792d626c6164653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)[![Last Commit](https://camo.githubusercontent.com/fe486b150a15b6a2ff373ba8b9ddf272412f047b6cec2471bb5e36e38c31eef6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6166626f72612f6b697262792d626c6164653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)[![Release](https://camo.githubusercontent.com/be224afd3853140c4ce41f5fc3b3866176ae7301d3abaa61c15e0591061ca971/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6166626f72612f6b697262792d626c6164653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)[![License](https://camo.githubusercontent.com/d38679c5f3112cede14baa619e3c5fea991494e347d3a44a2b9b4f94c979b699/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6166626f72612f6b697262792d626c6164653f7374796c653d666c61742d737175617265)](https://github.com/afbora/kirby-blade)

Kirby Blade use Laravel `illuminate/view` 9.x package and compatible with Kirby 3.

This package enable [Laravel Blade](https://laravel.com/docs/9.x/blade) for your own Kirby applications.

Kirby compatibility table
-------------------------

[](#kirby-compatibility-table)

Kirby versionCompatible plugin version^3.6^1.9^3.7^2.0Important note before installation for Kirby
--------------------------------------------

[](#important-note-before-installation-for-kirby)

You should to override Kirby's `e()` helper function from root `index.php` of your application. Because Laravel Blade also has a helper function called `e()`.

```
// override Kirby `e()` helper for Blade plugin
define('KIRBY_HELPER_E', false);
```

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

[](#installation)

### Installation with composer

[](#installation-with-composer)

```
composer require afbora/kirby-blade

```

### Add as git submodule

[](#add-as-git-submodule)

```
git submodule add https://github.com/afbora/kirby-blade.git site/plugins/kirby-blade

```

### Manual

[](#manual)

- Download the latest release
- Unzip downloaded file
- Copy/paste unzipped folder in your /site/plugins folder

What is Blade?
--------------

[](#what-is-blade)

According to Laravel Blade documentation is:

> Blade is the simple, yet powerful templating engine provided with Laravel. Unlike other popular PHP templating engines, Blade does not restrict you from using plain PHP code in your views. In fact, all Blade views are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to your application. Blade view files use the .blade.php file extension.

Usage
-----

[](#usage)

You can use the power of Blade like [Layouts](https://laravel.com/docs/9.x/blade#building-layouts), [Forms](https://laravel.com/docs/9.x/blade#forms), [Sub-Views](https://laravel.com/docs/9.x/blade#including-subviews), [Components](https://laravel.com/docs/9.x/blade#components), [Directives](https://laravel.com/docs/9.x/blade#blade-directives) and your custom if statements.

All the documentation about Laravel Blade is in the [official documentation](https://laravel.com/docs/9.x/blade).

Options
-------

[](#options)

The default values of the package are:

OptionDefaultValuesDescriptionafbora.blade.templatessite/templates(string)Location of the templatesafbora.blade.viewssite/cache/views(string)Location of the views cachedafbora.blade.directives\[\](array)Array with the custom directivesafbora.blade.ifs\[\](array)Array with the custom if statementsafbora.blade.minify.enabledfalse(boolean)Enable/disable minify HTML outputafbora.blade.minify.options\[\](array)Minify supported optionsAll the values can be updated in the `config.php` file.

### Templates

[](#templates)

Default templates folder is `site/templates` directory or wherever you define your `templates` directory, but you can change this easily:

```
'afbora.blade.templates' => '/theme/default/templates',
```

### Views

[](#views)

All the views generated are stored in `site/cache/views` directory or wherever you define your `cache` directory, but you can change this easily:

```
'afbora.blade.views' => '/site/storage/views',
```

### Directives

[](#directives)

By default Kirby Blade comes with following directives:

```
@asset($path)
@csrf()
@css($path)
@dump($variable)
@e($condition, $value, $alternative)
@get($key, $default)
@gist($url)
@go($url, $code)
@h($string, $keepTags)
@html($string, $keepTags)
@js($path)
@image($path, $attr) // @image('forrest.jpg', 'url')
@kirbytag($type, $value, $attr)
@kirbytags($text, $data)
@kirbytext($text, $data)
@kirbytextinline($text)
@kt($text)
@markdown($text)
@option($key, $default)
@page($key, $attr) // @page('blog', 'title')
@param($key, $fallback)
@site($attr) // @site(title')
@size($value)
@smartypants($text)
@snippet($name, $data)
@svg($file)
@t($key, $fallback)
@tc($key, $count)
@tt($key, $fallback, $replace, $locale)
@u($path, $options)
@url($path, $options)
@video($url, $options, $attr)
@vimeo($url, $options, $attr)
@widont($string)
@youtube($url, $options, $attr)
```

But you can create your own:

```
'afbora.blade.directives' => [
    'greeting' => function ($text)
    {
        return "";
    },
],
```

Kirby Helpers Documentation:

### If Statements

[](#if-statements)

Like directives, you can create your own if statements:

```
'afbora.blade.ifs' => [
    'logged' => function ()
    {
        return !!kirby()->user();
    },
],
```

After declaration you can use it like:

```
@logged
    Welcome back {{ $kirby->user()->name() }}
@else
    Please Log In
@endlogged
```

### Minify

[](#minify)

**Setup**

```
'afbora.blade.minify.enabled' => true,
'afbora.blade.minify.options' => [
    'doOptimizeViaHtmlDomParser' => true, // set true/false or remove line to default
    'doRemoveSpacesBetweenTags'  => false // set true/false or remove line to default
],
```

**Available Minify Options**

OptionDescriptiondoOptimizeViaHtmlDomParseroptimize html via "HtmlDomParser()"doRemoveCommentsremove default HTML comments (depends on "doOptimizeViaHtmlDomParser(true)")doSumUpWhitespacesum-up extra whitespace from the Dom (depends on "doOptimizeViaHtmlDomParser(true)")doRemoveWhitespaceAroundTagsremove whitespace around tags (depends on "doOptimizeViaHtmlDomParser(true)")doOptimizeAttributesoptimize html attributes (depends on "doOptimizeViaHtmlDomParser(true)")doRemoveHttpPrefixFromAttributesremove optional "http:"-prefix from attributes (depends on "doOptimizeAttributes(true)")doRemoveHttpsPrefixFromAttributesremove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")doKeepHttpAndHttpsPrefixOnExternalAttributeskeep "http:"- and "https:"-prefix for all external linksdoMakeSameDomainsLinksRelativemake some links relative, by removing the domain from attributesdoRemoveDefaultAttributesremove defaults (depends on "doOptimizeAttributes(true)"doRemoveDeprecatedAnchorNameremove deprecated anchor-jump (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedScriptCharsetAttributeremove deprecated charset-attribute - the browser will use the charset from the HTTP-Header, anyway (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromScriptTagremove deprecated script-mime-types (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromStylesheetLinkremove "type=text/css" for css links (depends on "doOptimizeAttributes(true)")doRemoveDeprecatedTypeFromStyleAndLinkTagremove "type=text/css" from all links and stylesdoRemoveDefaultMediaTypeFromStyleAndLinkTagremove "media="all" from all links and stylesdoRemoveDefaultTypeFromButtonremove type="submit" from button tagsdoRemoveEmptyAttributesremove some empty attributes (depends on "doOptimizeAttributes(true)")doRemoveValueFromEmptyInputremove 'value=""' from empty `` (depends on "doOptimizeAttributes(true)")doSortCssClassNamessort css-class-names, for better gzip results (depends on "doOptimizeAttributes(true)")doSortHtmlAttributessort html-attributes, for better gzip results (depends on "doOptimizeAttributes(true)")doRemoveSpacesBetweenTagsremove more (aggressive) spaces in the dom (disabled by default)doRemoveOmittedQuotesremove quotes e.g. class="lall" =&gt; class=lalldoRemoveOmittedHtmlTagsremove ommitted html tags e.g. &lt;p&gt;lall&lt;/p&gt; =&gt; &lt;p&gt;lallYou can get detailed information from `HtmlMin` library: [voku/HtmlMin](https://github.com/voku/HtmlMin#options)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.6% 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 ~73 days

Recently: every ~142 days

Total

16

Last Release

1468d ago

Major Versions

1.9.2 → 2.0.0-rc.12022-06-22

PHP version history (5 changes)1.0PHP ^7.1.3

1.6.0PHP ^7.2

1.9.0PHP ^7.3

1.9.1PHP ^7.3|^8.0

2.0.0-rc.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/78e176965f9f86b8de5a5e684e12df12a7ee15aca2848cf4394c30941c50ae7e?d=identicon)[afbora](/maintainers/afbora)

---

Top Contributors

[![afbora](https://avatars.githubusercontent.com/u/3393422?v=4)](https://github.com/afbora "afbora (41 commits)")[![adamkiss](https://avatars.githubusercontent.com/u/481362?v=4)](https://github.com/adamkiss "adamkiss (1 commits)")

---

Tags

bladekirbykirby-bladekirby-cmskirby-pluginkirby3-pluginlaravelminifytemplatetemplate-enginetemplating-engineviewlaravelbladetemplateviewtemplate enginekirbykirby-pluginkirby3-pluginkirby-bladekirby-3

### Embed Badge

![Health badge](/badges/afbora-kirby-blade/health.svg)

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

###  Alternatives

[leitsch/kirby-blade

Enable Laravel Blade Template Engine for Kirby 4 and Kirby 5

2110.1k](/packages/leitsch-kirby-blade)[jenssegers/blade

The standalone version of Laravel's Blade templating engine for use outside of Laravel.

8651.3M114](/packages/jenssegers-blade)[spatie/laravel-blade-comments

Add debug comments to your rendered output

179332.0k](/packages/spatie-laravel-blade-comments)[beebmx/kirby-blade

Blade template for Kirby

141.9k2](/packages/beebmx-kirby-blade)[fiskhandlarn/blade

A library for using Laravel Blade templates in WordPress/WordPlate.

366.0k](/packages/fiskhandlarn-blade)

PHPackages © 2026

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