PHPackages                             nabeelalihashmi/lightview - 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. nabeelalihashmi/lightview

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

nabeelalihashmi/lightview
=========================

Lightweight template engine

v1.0.0(3y ago)513MITPHP

Since Jun 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nabeelalihashmi/LightView)[ Packagist](https://packagist.org/packages/nabeelalihashmi/lightview)[ RSS](/packages/nabeelalihashmi-lightview/feed)WikiDiscussions master Synced 4w ago

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

[![LightView](./docs/header.png)](./docs/header.png)

LightView
=========

[](#lightview)

A Fast, Easy and Lightweight Template Engine for Web Applications. [Based on article by David Adams](https://codeshack.io/lightweight-template-engine-php/). The unique feature added is concept of computed output.

Features
--------

[](#features)

```
* Fast
* Easy
* Lightweight
* Supports Layout
* Supports Computed output

```

Installtion
-----------

[](#installtion)

```
composer require nabeelalihashmi/LightView

```

Basic Usage
-----------

[](#basic-usage)

Configure your application's views folder and cache folder

```
LightView::$cache_path = '../cache';
LightView::$views_path = '../app/views';

```

Render the view like

```
LightView::view('myView.html', ['message' => 'Hi']);

```

A view can be:

```

		{% yield title %}

	{% include partials/nav.html %}
    {% yield content %}

{% extends layouts/main.html %}

{% block title %}Home Page{% endblock %}

{% block content %}
Home
Welcome to the home page!

    We Have A Message For You
    {{ $message }}
    {%
        echo 'hi';
    %}

{% endblock %}

```

Layout
------

[](#layout)

Layout can be simple file having multiple yields and includes.

PHP Code
--------

[](#php-code)

You can use php code inside `{% %}` block

```
{%  echo 'hi'; %}
{%  foreach($messages as $message): %}
 {{ $msg }}
{% endforeach %}

```

---

Computed Block
--------------

[](#computed-block)

This outputs the html output of code instead of echoing. Good for saving resources.

```
{( Namespace\Class,method,arg1,arg2 )}

```

Print Escaped
-------------

[](#print-escaped)

```
{{ $variable }}

```

Print Unescape
--------------

[](#print-unescape)

```
{! $variable !}

```

License
-------

[](#license)

LightView is released under permissive licese with following conditions:

- It cannot be used to create adult apps.
- It cannot be used to gambling apps.
- It cannot be used to create apps having hate speech.

### MIT License

[](#mit-license)

Copyright 2022 Nabeel Ali | IconicCodes.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1420d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/449341cf2d2c255eeaa52f06da4293fdcf2f407b10984846b6c130418c7b4eab?d=identicon)[nabeelalihashmi](/maintainers/nabeelalihashmi)

---

Top Contributors

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

---

Tags

php-libraryphp-template-enginephp-templatingtemplate-engine

### Embed Badge

![Health badge](/badges/nabeelalihashmi-lightview/health.svg)

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

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M290](/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)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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