PHP code example of rnr1721 / le7-jsenv

1. Go to this page and download the library: Download rnr1721/le7-jsenv library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rnr1721 / le7-jsenv example snippets


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();