PHPackages                             mtymek/blast-view - 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. mtymek/blast-view

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

mtymek/blast-view
=================

Standalone template renderer using templating engine from Zend Framework 2 - Zend\\View.

0.6.1(10y ago)0552-Clause BSDPHP

Since Jul 19Pushed 10y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Blast\\View
===========

[](#blastview)

Standalone template renderer using templating engine from Zend Framework 2 - `Zend\View`.

You can use it to render PHTML files outside the context of ZF2 MVC, but with all `Zend\View` features: nested templates, view helpers, etc.

Example use cases:

- generating HTML from command line applications
- rendering HTML e-mails
- using `Zend\View` without other Zend Framework components

[![Build Status](https://camo.githubusercontent.com/874969963e27ec4bc516d081f893471eb9a7842b7358c9d7df0c3c862ad63b15/68747470733a2f2f7472617669732d63692e6f72672f6d74796d656b2f626c6173742d766965772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mtymek/blast-view)[![Coverage Status](https://camo.githubusercontent.com/e066c2506c68409fe8aea2139b948d9b655cd856087115a8001ca9a039cf9128/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d74796d656b2f626c6173742d766965772f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/mtymek/blast-view?branch=master)

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

[](#installation)

1. Install package using composer:

    ```
    $ composer require mtymek/blast-view ~0.5
    ```
2. Add `Blast\View` to module list in your system configuration (`config/application.config.php` file).

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

[](#configuration)

`Blast\View` uses configuration keys similar to regular Zend application. Currently you can configure two options:

- location to view templates (`template_path_stack` key)
- default layout (`layout_template` key)

```
return [
    'view_manager' => [
        'layout_template' => 'layout/layout.phtml',
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
    ],
];
```

Usage
-----

[](#usage)

Once installed, `Blast\View` module will register new service: `Blast\View\View` in application's main `ServiceManager`. It can be easily pulled from there to render templates outside of ZF2 MVC:

```
use Zend\View\Model\ViewModel;
use Blast\View\View;

$viewModel = new ViewModel(
    [
        'name' => 'Mat'
    ]
);
$viewModel->setTemplate('index.phtml');

$view = $serviceManager->get(View::class);
echo $view->render($viewModel);
```

### Layouts

[](#layouts)

Layout is just a parent `ViewModel` wrapping your main view script. It should be injected using `setLayout()` method before rendering main template:

```
$layout = new ViewModel();
$layout->setTemplate('layout/layout.phtml');
$view->setLayout($layout);

$viewModel = new ViewModel();
$viewModel->setTemplate('index.phtml');
echo $view->render($viewModel);
```

Layout template has the same structure as in ZF2:

```

    content ?>

```

### View Helpers

[](#view-helpers)

`Blast\View` supports custom view helpers via `view_helpers` configuration key, in the same manner as ZF2 does. Here's an example config that registers `foo` view helper:

```
return [
    'view_helpers' => [
        'invokables' => [
            'foo' => FooHelper::class,
        ]
    ],
];
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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

Every ~8 days

Total

4

Last Release

3932d ago

### Community

Maintainers

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

---

Top Contributors

[![mtymek](https://avatars.githubusercontent.com/u/777893?v=4)](https://github.com/mtymek "mtymek (18 commits)")

---

Tags

templaterendererlayoutview helperzend view

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mtymek-blast-view/health.svg)

```
[![Health](https://phpackages.com/badges/mtymek-blast-view/health.svg)](https://phpackages.com/packages/mtymek-blast-view)
```

PHPackages © 2026

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