PHPackages                             vanvanni/marko-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. vanvanni/marko-blade

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

vanvanni/marko-blade
====================

Blade templating driver for the Marko Framework

v1.0.0-rc7(1mo ago)24MITPHPPHP ^8.5CI passing

Since May 1Pushed 1mo agoCompare

[ Source](https://github.com/vanvanni/marko-blade)[ Packagist](https://packagist.org/packages/vanvanni/marko-blade)[ RSS](/packages/vanvanni-marko-blade/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

Marko Blade
===========

[](#marko-blade)

The past 10 years I have been running Laravel, brought there due to Blade one day. Now I developed a great love for Blade templating engine and wanted to bring it to the Marko Framework.

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

[](#installation)

```
composer require vanvanni/marko-blade
```

This automatically installs `marko/view`.

Configuration
-------------

[](#configuration)

Configure via the `view` config key:

```
return [
    'cache_directory' => '/path/to/cache',
    'extension' => '.blade.php',
    'auto_refresh' => true,  // Set false in production
    'strict_types' => false, // Blade does not support strict types
];
```

Usage
-----

[](#usage)

Templates are rendered using the module namespace syntax:

```
use Marko\View\ViewInterface;

$view->render('blog::post/index', ['posts' => $posts]);
```

The format is `module::path/to/template` where:

- `module` is the module name (e.g., `blog`, `admin`)
- `path/to/template` is the path within `resources/views/`

Use `renderToString()` when you need the raw HTML:

```
$html = $view->renderToString('blog::email/welcome', $data);
```

### Blade Directives

[](#blade-directives)

All Blade directives work out of the box:

```
@extends('blog::layout')

@section('content')
    @foreach($posts as $post)
        @include('blog::post.item', ['post' => $post])
    @endforeach
@endsection
```

Includes must use the module namespace format:

```
@include('blog::post/list/item', ['post' => $post])
@include('blog::pagination/index', ['pagination' => $posts])
```

Relative paths (`../`) are not supported. This ensures consistent syntax throughout templates.

### Components

[](#components)

Anonymous Blade components are supported:

```

```

Using with `marko/vite`
-----------------------

[](#using-with-markovite)

`marko-blade` requires `illuminate/view`, which in turn requires `illuminate/support`. Both `illuminate/support` and `marko/vite` (via `marko/env`) define a global `env()` helper.

Because both packages use `function_exists('env')` guards, no fatal error occurs. In practice, Laravel's `env()` typically loads first (it is a deeper dependency in Composer's graph) and is used. Both implementations are compatible for typical config usage — both coerce `'true'` → `true`, `'false'` → `false`, `'null'` → `null`, and `'empty'` → `''`.

`illuminate/support` lists `vlucas/phpdotenv` as a suggested dependency, but its `Env` class cannot function without it. `marko-blade` explicitly requires `vlucas/phpdotenv` so Laravel's `env()` works correctly in any Marko project, even when the framework itself is not installed.

### `@viteHeadTags` Blade Directive

[](#viteheadtags-blade-directive)

When `marko/vite` is installed and enabled, `marko-blade` automatically registers a `@viteHeadTags` directive:

```

    @viteHeadTags
    My App

    ...

```

By default, it uses the entry point configured in `config/vite.php` (`vite.entry`). You can also pass a specific entry:

```
@viteHeadTags('app/web/resources/js/app.js')
```

In development mode (`vite.useDevServer = true`), this emits `` tags pointing at the Vite dev server. In production, it reads the manifest and emits hashed ``, ``, and `` tags.

Differences from Latte
----------------------

[](#differences-from-latte)

- **Strict Types**: Blade does not support `strict_types` because compiled templates are `include`d at runtime.
- **Auto Refresh**: When `auto_refresh` is `false`, templates are only compiled once. In production, you should set this to `false`.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance92

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Total

7

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/425972de56f0dd9e2525c85ca6fac67145a06dbc948a9ad66c1a8e6214d943f5?d=identicon)[vanvanni](/maintainers/vanvanni)

---

Top Contributors

[![vanvanni](https://avatars.githubusercontent.com/u/13612647?v=4)](https://github.com/vanvanni "vanvanni (14 commits)")

---

Tags

blademarkomarko-phptemplate-engine

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/vanvanni-marko-blade/health.svg)

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

###  Alternatives

[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k449.3k30](/packages/tightenco-jigsaw)[illuminate/view

The Illuminate View package.

13046.3M2.1k](/packages/illuminate-view)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)

PHPackages © 2026

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