PHPackages                             brightnucleus/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. [Templating &amp; Views](/categories/templating)
4. /
5. brightnucleus/view

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

brightnucleus/view
==================

Reusable View component, that can provide different implementations.

v0.5.1(9mo ago)166.5k↓50%2[3 issues](https://github.com/brightnucleus/view/issues)6MITPHPPHP &gt;=8.0CI failing

Since May 28Pushed 8mo ago2 watchersCompare

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

READMEChangelogDependencies (9)Versions (20)Used By (6)

Bright Nucleus View Component
=============================

[](#bright-nucleus-view-component)

[![Build Status](https://github.com/brightnucleus/view/actions/workflows/testing.yml/badge.svg)](https://github.com/brightnucleus/view/actions/workflows/testing.yml)[![Latest Stable Version](https://camo.githubusercontent.com/696b5d6c42c2365338a58e88ef84fc5adb8034bbd72f321178b90ef1be39b985/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272696768746e75636c6575732f766965772e737667)](https://packagist.org/packages/brightnucleus/view)[![Total Downloads](https://camo.githubusercontent.com/0cd23ec4284d1ef4659770eedff37ae92f923615e2350d5c06bae85bff3754ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272696768746e75636c6575732f766965772e737667)](https://packagist.org/packages/brightnucleus/view)[![License](https://camo.githubusercontent.com/d7920e7087eab682f80f780a3cdc36a7a1b9da570113bb8a9abc900f2ae51b69/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6272696768746e75636c6575732f766965772e737667)](https://packagist.org/packages/brightnucleus/view)

This is a reusable View component that can provide different implementations (in separate, optional packages).

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Basic Usage](#basic-usage)
    - [Adding Locations](#adding-locations)
    - [Rendering A View](#rendering-a-view)
- [Advanced Usage](#advanced-usage)
- [Contributing](#contributing)
- [License](#license)

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

[](#installation)

The best way to use this component is through Composer:

```
composer require brightnucleus/view
```

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

[](#basic-usage)

The simplest way to use the `View` component is through its Facade: `BrightNucleus\Views`.

This Facade makes use of a basic `BaseView` View implementation as well as a basic `PHPEngine` Engine implementation. It can just be used as is and does not need additional configuration.

### Adding Locations

[](#adding-locations)

You can add locations via the static `View::addLocation($location)` method. Each location needs to implement the `Location`. The `View` component comes with one location provider out of the box: `FilesystemLocation`.

Here's how to add a set of folders as a new location:

```
Welcome screen for User with ID
This is an example template to show the rendering of partials.
