PHPackages                             elvenspellmaker/glaza - 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. elvenspellmaker/glaza

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

elvenspellmaker/glaza
=====================

Basic View Parser

1.0.0(9y ago)2401PHPPHP &gt;=5.5.0CI passing

Since Jan 15Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ElvenSpellmaker/Glaza)[ Packagist](https://packagist.org/packages/elvenspellmaker/glaza)[ RSS](/packages/elvenspellmaker-glaza/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Глаза (Glaza)
=============

[](#глаза-glaza)

Глаза is a *very* basic view handler and parser for PHP views.

Installing
----------

[](#installing)

Installing can be done through Composer:

`composer require ElvenSpellmaker/Glaza`

If you don't want to use Composer, then clone the repo and include the provided AutoLoader: ```php`

set( 'foo', 'World!' ); ``` Views can contain other views too: ```php` $view-&gt;set('bar', new View( 'NestedView' ) ); ``` ### Rendering A View In `ViewTestHtml.php` is the code: ```php Hello ```

```

``` Rendering Views is really easy. Either call their `render` method, or typecast them to a string, either by an explicit cast `(string)` or by trying to echo the view: `echo $view`.

> Note: Views are rendered from the inside-out, which while it makes sense is worth pointing out.

Using the above exmaple the output is shown below:

```

        Hello World!

```

### Automatic Escaping (Sanitisation)

[](#automatic-escaping-sanitisation)

Consider the following code: ```php` $view-&gt;set('foo', '**Not Bold**');

```
The above will render as `&lt;b&gt;Not Bold&lt;/b&gt;` --> Not Bold because by default `htmlspecialchars()` is used to sanitise input.
In order to override this, pass `false` as the third argument to `View::set`:
```php`
$view->set('foo', 'Bold', false);

```

This will render as `Bold/b>` --&gt; **Bold** which might be what you wanted!

### Finding Views In Other Directories

[](#finding-views-in-other-directories)

It's very likely you want to find your views in other directories and this is possible in two ways:

1. Specify the full path to the View as you create the View: `$view = new View( '/full/path/to/view' );`
2. Use the `ViewManager` class and add paths to search through. (This will be ultimately slower especially with the more paths that are added)

An example of method 2 is shown below:

```
use ElvenSpellmaker\Глаза\ViewManager;

ViewManager::addViewPath( __DIR__ ); // Adds the current script's path to the ViewManager.
```

Now when you create a new view it will first search the current working directory and *then* search the added directory. The order the directories are searched in is the order in which they are added. It it possible to add the path to be added to the beginning of the path list, by passing `false` to `ViewManager::addViewPath` as a second parameter. This will `array_unshift` the path to the front of the list.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

3453d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2286713?v=4)[Jack Blower](/maintainers/ElvenSpellmaker)[@ElvenSpellmaker](https://github.com/ElvenSpellmaker)

---

Top Contributors

[![ElvenSpellmaker](https://avatars.githubusercontent.com/u/2286713?v=4)](https://github.com/ElvenSpellmaker "ElvenSpellmaker (4 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/elvenspellmaker-glaza/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.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.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

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

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

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

281.8k](/packages/webkinder-sproutset)

PHPackages © 2026

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