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

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

litphp/view-php
===============

A view that use native PHP to render output for lit

v0.9.0(6y ago)05ISCPHP

Since May 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/litphp/view-php)[ Packagist](https://packagist.org/packages/litphp/view-php)[ RSS](/packages/litphp-view-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

PhpView for lit
===============

[](#phpview-for-lit)

> Native php templating for lit

with [slim/php-view](https://github.com/slimphp/PHP-View)

### Usage

[](#usage)

In a standard [litphp/project](https://github.com/litphp/project):

- add dependency &amp; install

```
composer require litphp/view-php
```

- append configuration

Create a template dir in your project root, says `template`. Write your first template file `templates/index.phtml`

```
Hello !
```

Merge `PhpView::configuration` into your `configuration.php`. (with parameter of `\Slim\Views\PhpRenderer`)

```
$configuration+=\Lit\View\Php\PhpView::configuration([__DIR__.'/templates']);
```

- integration in action class

In `src/BaseAction.php`, use the trait `PhpViewBuilderTrait`

```
abstract class BaseAction extends BoltAbstractAction
{
    use \Lit\View\Php\PhpViewBuilderTrait;
```

Change your `src/HomeAction.php` to render page

```
class HomeAction extends BaseAction
{
    protected function main(): ResponseInterface
    {
        return $this->template('index.phtml')->render(['name' => 'native php']);
    }
```

That's all! Run your app by `php -S 127.0.0.1:3080 public/index.php`, and open . You should see greetings from template "Hello native php!"

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~48 days

Total

2

Last Release

2512d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/775be499f40ae974a25327900e28fa6eba931b1c7a4332097d027127ba582ba2?d=identicon)[mcfog](/maintainers/mcfog)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  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)[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)
