PHPackages                             pkit/phantom - 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. pkit/phantom

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

pkit/phantom
============

A simple module to handle views

v0.1.1(2y ago)0271MITPHPPHP &gt;=8.1

Since Feb 15Pushed 2y agoCompare

[ Source](https://github.com/pkit-php/phantom)[ Packagist](https://packagist.org/packages/pkit/phantom)[ RSS](/packages/pkit-phantom/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

phantom
=======

[](#phantom)

A simple module to handle views

Installation
------------

[](#installation)

Using Composer, enter the following command:

```
composer require pkit/phantom
```

Usage
-----

[](#usage)

### Rendering

[](#rendering)

Initially, the page is rendered through the static class `Pkit\Phantom`.

```
use Pkit\Phantom;
use Pkit\View;

# ".\view" is the default directory, and views are discovered without file extension
return Phantom::render("page", ["var" => $value]);
/***/
return Phantom::renderView(new View(/* path */), "dir/page");
```

### Pages

[](#pages)

The page is written in vanilla PHP, and the extension used is `.phtml`, which cannot be modified.

```

```

### Components

[](#components)

```
# ./view/component.phtml
component

```

To add components, the `include` method is basically used.

```
# ./view/master.phtml

```

### Sections

[](#sections)

It is possible to create templates using the slot syntax.

```
# ./view/master.phtml

```

To use them on the page, you should extend the view and thus, by wrapping the sections, they will be delivered to the slots.

```

# text...

# The text in these intervals will be ignored
# Note: the code in this area will still be executed

# text...

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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 ~0 days

Total

2

Last Release

822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96e29a59b3693fd2f2b06e95fa8332a8967940bebac942ac5ad9514b59428298?d=identicon)[kau-gusto](/maintainers/kau-gusto)

---

Top Contributors

[![kau-gusto](https://avatars.githubusercontent.com/u/94973650?v=4)](https://github.com/kau-gusto "kau-gusto (11 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/pkit-phantom/health.svg)

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

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