Skip to content

stepapo/generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Generator

Tool for generating empty Nette Presenters, Components and Nextras ORM model files with basic structure.

Usage

Presenter

$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,
);

Component

$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,
);

Model

$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,
);

Service

$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,
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages