PHPackages                             conectra/phpview - 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. conectra/phpview

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

conectra/phpview
================

PhpView is a simple template engine for php

v0.2.0(8y ago)014GPL-3.0+PHP

Since Jul 13Pushed 8y ago3 watchersCompare

[ Source](https://github.com/conectra/phpview)[ Packagist](https://packagist.org/packages/conectra/phpview)[ RSS](/packages/conectra-phpview/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

README
======

[](#readme)

O que é o PhpView
-----------------

[](#o-que-é-o-phpview)

PhpView é um simples mecanismo de gerenciamento de templates html em PHP

Como instalar?
--------------

[](#como-instalar)

Esse pacote foi estruturado para ser instalado por meio do composer.

```
composer require solis/phpview

```

Como utilizar?
--------------

[](#como-utilizar)

Declare o uso da classe View e utilize seu método estático make

```
use Solis\PhpView\View\View

$view = View::make($name, $data, $path);

```

A chamada ao método estático retorna uma instância de ViewContract que é responsável por renderizar o html como string

```
$view->render();

```

Como Funciona
-------------

[](#como-funciona)

O objeto View é instanciado utilizando o método estático make, qual recebe 3 argumentos:

- $name - nome real do arquivo qual contém o conteúdo html.
- $data - array associativo contendo os dados a serem renderizados na string html.
- $path - caminho para o diretório que contém o respectivo arquivo html.

Uma instancia valida do objeto é demonstrada a seguir

```
$main = View::make('main.html', [
    'title' => 'content to place in a {title} entry in main.html',
    'message' => 'content to place in a {message} entry in main.html'
],  dirname(__FILE__) . "/");

```

O ViewContract utiliza o conceito de anexos para representar outras Views html vinculadas a si. Um anexo (Attachment) contém um array de implementações de ViewContract.

```
$main->setAttachment(Attachment::make([
    View::make('attached.html', [
        'title' => 'content to place in a {title} entry in attached.html',
        'message' => 'content to place in a {message} entry in attached.html'
    ], dirname(__FILE__) . "/")
]));

```

Uma ViewContract utilizada como anexo é renderizada por padrão, porém é possível ocultá-la caso necessário

```
$main->getAttachment()->getEntry('attached.html')->setDraw(false);

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Total

3

Last Release

3123d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e81f41c2938cae87b956df83b30bfb165b395bda6cd28b77581e4d36c87c1a3?d=identicon)[conectra](/maintainers/conectra)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/conectra-phpview/health.svg)

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

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