PHP code example of effectra / generator

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

    

effectra / generator example snippets


$creator = new Creator();

$generator = new GeneratorClass($creator, 'MyClass');

$template = $generator->generate();

$template->save('/path/to/MyClass.php');

$creator = new Creator();

$configFile = new ConfigFile('/path/to/config.php');
$generator = new GeneratorConfigFile($creator, $configFile);

$section = 'database';
$config = [
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'mydatabase',
    'username' => 'myusername',
    'password' => 'mypassword',
];

$template = $generator->createSection($section, $config);

$template->save('/path/to/config.php');