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

ActiveLibrary

humble/view
===========

HUMBLE View

013PHP

Since Oct 18Pushed 9y agoCompare

[ Source](https://github.com/humblephp/humble-view)[ Packagist](https://packagist.org/packages/humble/view)[ RSS](/packages/humble-view/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

humble-view
===========

[](#humble-view)

[![Latest Version](https://camo.githubusercontent.com/22e7ea247ef76577bd3c9159f85907eca05a9185c406b74cab5b992dbf2c30b5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68756d626c657068702f68756d626c652d766965772e737667)](https://github.com/humblephp/humble-view/releases)[![Software License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2e52be005af5647fa96641020a2b7f11db36b0705b1746ff7ff0f255679c98a7/68747470733a2f2f6170692e7472617669732d63692e6f72672f68756d626c657068702f68756d626c652d766965772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/humblephp/humble-view)

HUMBLE View

Install
-------

[](#install)

Via Composer

```
$ composer require humble/view
```

Usage
-----

[](#usage)

Get Php View.

```
$view = new \Humble\View\View;

```

Set template path.

```
$view->setTemplatePath('/absolute/path/to/templates/');

```

Set layout.

```
$view->setLayout('relative/path/to/layout.php');

```

Get Php View with predefined settings.

```
$view = new \Humble\View\View([
    'templatePath' => '/absolute/path/to/templates/',
    'layout' => 'relative/path/to/layout.php',
]);

```

Register extension.

```
$extension = new Extension
$view->register('extensionName', $extension);

```

Register callback.

```
$callback = function(string $string) { return strtoupper($string); };
$view->register('callableName', $callback);

```

Get registered extension.

```
$view->get('extensionName');

```

Get registered callable extension or callback.

```
$view->call('callableName', 'string');

```

Render PSR-7 response with layout section.

```
$view->render(new Response(), array('section' => 'relative/path/to/section.php'));

```

Render PSR-7 response with layout sections, and view data.

```
$view->render(new Response(), [
    'header' => 'relative/path/to/header.php',
    'content' => 'relative/path/to/content.php',
], [
    'data' => array(),
]);

```

Get layout output.

```
$view->layout('relative/path/to/layout/default.php', [
    'section' => 'relative/path/to/section.php',
], [
    'data' => array(),
]);

```

Get partial output.

```
$view->partial('relative/path/to/partial.php', [
    'data' => array(),
]);

```

Get absolute path to template.

```
$view->getTemplate('relative/path/to/template.php');

```

Use sections in layout.

```

```

Use view data in layout, or section.

```

```

Use extension in layout, section, or partial.

```

```

Use callable in layout, section, or partial.

```

```

Include layout in other layout, section, or partial.

```

```

Include partial in layout, section, or other partial.

```

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b7f2440906b221ed621f106dca65931a0d2de3516a523782923fdf581da3f03?d=identicon)[arekwiertlewski](/maintainers/arekwiertlewski)

### Embed Badge

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

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

PHPackages © 2026

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