PHPackages                             rnr1721/le7-jsenv - 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-jsenv

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-jsenv
=================

JS variable environment for le7 PHP MVC framework or any PHP project

1.0.4(2y ago)0701MITPHPPHP &gt;=8.1

Since Apr 1Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (6)Used By (1)

le7-jsenv
=========

[](#le7-jsenv)

JS variable environment for le7 PHP MVC framework or any PHP project

This is simple classes for transfer some data to Javascript, such as API addresses, AJAX callback URLs etc.

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

[](#requirements)

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

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

[](#what-it-can)

- Transfer data from PHP to JS as constants
- Store data type as possible - bool, int, float, string (array will be converted to string JSON)

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

[](#installation)

```
composer require rnr1721/le7-jsenv
```

Testing
-------

[](#testing)

```
composer test
```

How it works?
-------------

[](#how-it-works)

```
use Core\Factories\JsEnvFactory;

    $jsEnvFactory = new JsEnvFactory();
    $jsEnv = $jsEnvFactory->getEnvHtml();

    $jsEnv->addOwn('url', 'http://site.com/ajax')
        ->addOwn('locale', 'ru_RU')
        ->addOwn('locale_short', 'ru');

    $jsEnv->addOwn('one', 1);
    $jsEnv->addOwn('two', 12.33);
    $jsEnv->addOwn('three', false);
    $jsEnv->addOwn('four', null);
    $jsEnv->addOwn('five', ["one", "two", "three"]);

    // You can add multiple by key=>value array
    // $jsEnv->addMultiple($array);

    $output = $jsEnv->export();
```

This example give us the next string that you can place on your webpage:

```

    const url = 'http://site.com/ajax';
    const locale = 'ru_RU';
    const locale_short = 'ru';
    const one = 1;
    const two = 12.33;
    const three = false;
    const four = null;
    const five = '[&quot;one&quot;,&quot;two&quot;,&quot;three&quot;]';

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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

Total

5

Last Release

1081d ago

### 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 (1 commits)")

---

Tags

frameworkcomponentle7le7-frameworkjsenv

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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