stepapo/generator

Library that generates empty Nette Presenters, Components and Services with basic structure and Nextras ORM model files.

Installs: 134

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/stepapo/generator

0.1.7 2025-09-12 10:21 UTC

This package is auto-updated.

Last update: 2025-10-01 15:20:21 UTC


README

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

Command

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