PHP code example of nrslib / cfg

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

    

nrslib / cfg example snippets


$meta = new ClassMeta('MyTestClass', 'nrslib');
$meta->setupClass()
    ->addUse('nrslib\Cfg\ClassRenderer')
    ->addUse('nrslib\Cfg\Meta\Classes\ClassMeta')
    ->setExtend('SuperClass')
    ->addImplement('MyInterface')
    ->addImplement('MyInterface2')
    ->setConstructor(function ($define) {
        $define
            ->addArgument('renderer', 'ClassRenderer')
            ->addBody('$this->renderer = $renderer;')
            ->addArgument('meta', 'ClassMeta')
            ->addBody('$this->meta = $meta;');
    });