PHPackages                             maslosoft/miniview - 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. maslosoft/miniview

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

maslosoft/miniview
==================

Mini view is minimal template rendering library with pluggable template engines. Out of the box it support plain PHP templates, Latte and Twig.

2.0.4(1y ago)14.2k4AGPLPHPPHP &gt;=8.1

Since Dec 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Maslosoft/MiniView)[ Packagist](https://packagist.org/packages/maslosoft/miniview)[ Docs](https://maslosoft.com/miniview/)[ RSS](/packages/maslosoft-miniview/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (25)Used By (4)

[![Miniview Logo](https://camo.githubusercontent.com/f41b62617ea68b4eec92bda5bc4916def0927b142e991e4ab671bc6b6e3c5f56/68747470733a2f2f6d61736c6f736f66742e636f6d2f6d696e69766965772f6d696e69766965772e737667)](https://maslosoft.com/miniview/) [Maslosoft Miniview](https://maslosoft.com/miniview/)
=====================================================================================================================================================================================================================================================================================================

[](#-maslosoft-miniview)

[*Mini view is minimal template rendering library with pluggable template engines. Out of the box it support plain PHP templates, Latte and Twig.*](https://maslosoft.com/miniview/)

[![Latest Stable Version](https://camo.githubusercontent.com/27eccfa28163ab8d949b6df5ad9b5d7a79798c12a20c82fa293753edfa933ef1/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f6d696e69766965772f762f737461626c652e737667)](https://packagist.org/packages/maslosoft/miniview "Latest Stable Version")[![License](https://camo.githubusercontent.com/f79deae96fa9baaa2767807486c550cf0e90f261213e1d2a12fe1deb56f1d681/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f6d696e69766965772f6c6963656e73652e737667)](https://packagist.org/packages/maslosoft/miniview "License")[ ![Scrutinizer Code Quality](https://camo.githubusercontent.com/ed8b5bc60373023b3377f938948cb1373387523be28ea7d0d074f804548bb4f7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61736c6f736f66742f4d696e69766965772f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Maslosoft/Miniview/?branch=master)[ ![Code Coverage](https://camo.githubusercontent.com/b851945f89061387fa93d60060f9ec6a41f91750ff80e6a7b42c4991cdac85e0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61736c6f736f66742f4d696e69766965772f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Maslosoft/Miniview/?branch=master)### Quick Install

[](#quick-install)

```
composer require maslosoft/miniview
```

### Documentation

[](#documentation)

[Full Miniview Documentation](https://maslosoft.com/miniview/docs/)

Minimal PHP view
================

[](#minimal-php-view)

PHP itself is a kind of templating language. Some other supplemental languages have been implemented too. To use each one of them, we need to know how to use it, locate file exacly, and use some low-level commands like `require`.

### Common interface

[](#common-interface)

This view library provides common interface for PHP, or other templating engines, with option to extend it. Main power of miniview, is that it requires minimum code and effort to use MVC like views. It will also locate file relativelly to currently used class. It is safe to use with any functions directly outputting text, as it will capture any output and allow it to be passed anywhere, or just be displayed.

Usage
-----

[](#usage)

This is some example widget using MiniView:

```
namespace Company\SomeNamespace;

use Maslosoft\MiniView\MiniView;

class MyWidget
{

	/**
	 * View renderer
	 * @var MiniView
	 */
	public $view = null;

	/**
	 * @var string
	 */
	public $version = '';

	public function __construct()
	{
		$this->view = new MiniView($this);
		$this->version = $this->view->getVersion();
	}

	public function show()
	{
		return $this->view->render('myView', ['user' => 'Joe'], true);
	}

	public function greet($name)
	{
		return "Nice to meet you $name!" . PHP_EOL;
	}
}
```

In view file, all widget public properties as well as methods are available using `$this`. View file is located in folder `views` located in same folder as widget class.

Example view file:

```
Hello !

The version is
```

Calling `show()` will return rendered view file located in `classFolder/views/myView.php` with variable `$user` with value `Joe`.

```
use Company\SomeNamespace\MyWidget;

require __DIR__ . '/../src/Miniview.php';
require __DIR__ . '/MyWidget.phps';

$widget = new MyWidget;

echo $widget->show();
```

### Run example

[](#run-example)

Go to examples folder and type `php run.php`

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

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

Recently: every ~210 days

Total

24

Last Release

547d ago

Major Versions

1.1.2 → 2.0.02022-09-14

### Community

Maintainers

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

---

Top Contributors

[![pmaselkowski](https://avatars.githubusercontent.com/u/520283?v=4)](https://github.com/pmaselkowski "pmaselkowski (94 commits)")

---

Tags

php

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/maslosoft-miniview/health.svg)

```
[![Health](https://phpackages.com/badges/maslosoft-miniview/health.svg)](https://phpackages.com/packages/maslosoft-miniview)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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