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 2mo ago

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 54% 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

3406d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69f8ce57577ab19e43be34457b756766e630e86ecc9475a960dd24ad6d525e00?d=identicon)[ElvenSpellmaker](/maintainers/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

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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