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

ActiveLibrary

webunion/view
=============

Simple template engine

11102PHP

Since Feb 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Webunion/View)[ Packagist](https://packagist.org/packages/webunion/view)[ RSS](/packages/webunion-view/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

View
====

[](#view)

Simple and Lightweight Tempate Class.

Examples:
---------

[](#examples)

Note that the `defaul.php` layout and page should exist, because the default layout and page are loaded automatically, but you can set it as a `__construct` parameter or using the `loadLayout` and `loadPage` methods. The default file extension is `.php`.

```
Folder Structure:
path
└───views
	├───layouts
    │   default.php
    │   empty.php
	│   ...
    │
    ├───pages
    │   │   default.php
    │   │   home.php
    │   │   ...
    │   └───partials
	│		partial.php
	│		...

```

/path/views/layouts/default.php

```
DOCTYPE html>

        {#PAGE_TITLE#}

    Hello, world!

```

/path/views/pages/home.php

```

```

/path/views/pages/partials/partial.php

```

    >
```

controller.php

```
use Webunion\View;
//The default layout and page are loaded automatically, but you can pass it as a parameter or using LoadLayout and LoadPage methods
$view = new View('path/views/');
$view->addFixData('PAGE_TITLE', 'Some Title Page');
$view->addData('someVar', 'Some Value');
$view->addData('anotherVar', array('a', 'b', 'c'));
$view->loadPartial('partialName', 'partials/partial');

echo $view->render('home', array('last'=>'Last value'));
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e5e2d4804ee92a43522d6f98f96241451451a003c86c006c2cca172bd9cfefe?d=identicon)[webunion](/maintainers/webunion)

---

Top Contributors

[![Webunion](https://avatars.githubusercontent.com/u/16048872?v=4)](https://github.com/Webunion "Webunion (17 commits)")[![ricardofontanelli](https://avatars.githubusercontent.com/u/5155786?v=4)](https://github.com/ricardofontanelli "ricardofontanelli (12 commits)")

### Embed Badge

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

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

PHPackages © 2026

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