PHPackages                             rnr1721/le7-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. [Framework](/categories/framework)
4. /
5. rnr1721/le7-view

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-view
================

View module for le7 PHP framework or any PSR PHP project

1.3.2(2y ago)02164MITPHPPHP &gt;=8.1

Since Mar 12Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (36)Used By (4)

le7-view
========

[](#le7-view)

Base View component for le7 framework or any PHP projects.

You can install any of this in any PHP 8 PSR project.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.
- Composer 2.0 or higher.

What it can?
------------

[](#what-it-can)

- AssetsCollection object for manage collections of JS and CSS
- WebPage object for store webpage header and scripts data
- ViewTrait that part of any view adapter for le7-framework

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

[](#installation)

This component is dependency for this projects:

-  - Twig renderer
-  - Smarty renderer
-  - PHP renderer

You must install one of them to use it, but...

```
composer require rnr1721/le7-view
```

Testing
-------

[](#testing)

```
composer test
```

AssetsCollection
----------------

[](#assetscollection)

This is great tool to manage assets collection. It can be controlled by special setter methods or you can set configuration array into constructor.

Example of configuration:

```
        $styles = [
            'bootstrap5' => 'https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css'
        ];

        $scripts = [
            'axios' => [
                // You can define with params as need
                'script' => 'https://cdnjs.cloudflare.com/ajax/libs/axios/1.4.0/axios.min.js',
                'params' => 'defer'
            ],
            // Or you can define scripts directly
            'jquery' => 'https://code.jquery.com/jquery-3.7.0.min.js',
            'vuejs' => 'https://cdn.jsdelivr.net/npm/vue@2.7.8/dist/vue.js',
            'bootstrap5' => 'https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js'
        ];

        $collections = [
            'mycollection' => [
                'scripts_header' => [
                    'vuejs'
                ],
                'scripts_footer' => [

                ],
                'styles' => [
                    'bootstrap5'
                ]
            ]
        ];
```

NOTE: Now you can use "variables" in CDN: URLs for local places: {url}, {libs}, {js}, {css} example: {url}/libs/jquery.js

Now, we can create instance of AssetsCollectionGeneric (implements AssetsCollectionInterface):

```
use Core\View\AssetsCollectionGeneric;
$ac = new AssetsCollectionGeneric($scripts, $styles, $collections);
```

### Methods for setting scripts

[](#methods-for-setting-scripts)

#### setStyle

[](#setstyle)

You can set new style to styles library:

```
$ac->setStyle('bootstrap5', 'https://link_to_bootstrap5.css');
```

#### setScript

[](#setscript)

You can set new scripts to styles library:

```
$params = 'defer' // Not-required
$ac->setScript('bootstrap5', 'https://link_to_bootstrap5.js', $params);
```

#### setCollection

[](#setcollection)

You can set new collection to styles library: For example, we need collection, where will be vuejs JS and bootstrap5 CSS: Of course, all scripts with keys need to be defined before.

```
// Add to header
$ac->setCollection('mycollection', ['vuejs'], [], ['bootstrap5']);
// Add to footer
$ac->setCollection('mycollection', [], ['vuejs'], ['bootstrap5']);
```

### WebPage object

[](#webpage-object)

WebPage object collects various information about web page and you can use in in webpage template - scripts, styles, meta-tags, import maps, title, description, keywords etc.

### ViewTopology object

[](#viewtopology-object)

ViewTopology needs to store base paths and urls.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

35

Last Release

1077d ago

Major Versions

0.0.3 → 1.0.02023-03-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/b056f4160d8f9302378726a35860b42bfa67c29760bb55fcacddfde2bfa6f6ac?d=identicon)[rnr1721](/maintainers/rnr1721)

---

Top Contributors

[![rnr1721](https://avatars.githubusercontent.com/u/122087344?v=4)](https://github.com/rnr1721 "rnr1721 (2 commits)")

---

Tags

frameworkviewcomponentle7le7-framework

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.8k18.5M1.6k](/packages/cakephp-cakephp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[yiisoft/yii-middleware

Yii Middleware

21151.3k1](/packages/yiisoft-yii-middleware)

PHPackages © 2026

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