PHP code example of betterbrief / silverstripe-jsconfig

1. Go to this page and download the library: Download betterbrief/silverstripe-jsconfig 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/ */

    

betterbrief / silverstripe-jsconfig example snippets


// Send an array of things to the frontend using JSConfig
JSConfig::add('name_of_json_key', MyObject::get()->toArray());