PHP code example of stepapo / generator

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

    

stepapo / generator example snippets


$options = getopt(null, ['appNamespace:', 'appDir:', 'name:', 'module:']);

$generator = new Stepapo\Generator\Generator(
	appNamespace: $options['appNamespace'] ?? 'App',
	appDir: __DIR__ . '/../' . ($options['appDir'] ?? 'app'),
);

$generator->createPresenter(
	name: $options['name'],
	module: $options['module'] ?? null,
);

$options = getopt(null, ['appNamespace:', 'appDir:', 'name:', 'module:', 'type:', 'entityName:', 'withTemplateName:']);

$generator = new Stepapo\Generator\Generator(
	appNamespace: $options['appNamespace'] ?? 'App',
	appDir: __DIR__ . '/../' . ($options['appDir'] ?? 'app'),
);

$generator->createComponent(
	name: $options['name'], 
	module: $options['module'] ?? null, 
	entityName: $options['entityName'] ?? null, 
	withTemplateName: $options['withTemplateName'] ?? false,
	type: $options['type'] ?? null,
);

$options = getopt(null, ['appNamespace:', 'appDir:', 'name:', 'module:', 'withConventions:']);

$generator = new Stepapo\Generator\Generator(
	appNamespace: $options['appNamespace'] ?? 'App',
	appDir: __DIR__ . '/../' . ($options['appDir'] ?? 'app'),
);

$generator->createModel(
	name: $options['name'], 
	module: $options['module'] ?? null, 
	withConventions: $options['withConventions'] ?? false,
);

$options = getopt(null, ['appNamespace:', 'appDir:', 'name:', 'module:']);

$generator = new Stepapo\Generator\Generator(
	appNamespace: $options['appNamespace'] ?? 'App',
	appDir: __DIR__ . '/../' . ($options['appDir'] ?? 'app'),
);

$generator->createService(
	name: $options['name'],
	module: $options['module'] ?? null,
);

$options = getopt(null, ['appNamespace:', 'appDir:', 'name:', 'module:']);

$generator = new Stepapo\Generator\Generator(
	appNamespace: $options['appNamespace'] ?? 'App',
	appDir: __DIR__ . '/../' . ($options['appDir'] ?? 'app'),
);

$generator->createCommand(
	name: $options['name'],
	module: $options['module'] ?? null,
);