Skip to content
docsv0.13.1

PluginScaffolder

Scaffolds a new plugin directory structure with milpa.json. Generates: plugins/{Name}/ ├── milpa.json ├── {Name}.php ├── Controllers/ ├── Services/ ├── Entities/ ├── Commands/ ├── Interfaces/ ├── Middleware/ ├── Migrations/ ├── Records/ └── Resources/views/

PluginScaffolder::__construct()

public function __construct(string $pluginsPath):

Parameters

Parameters of __construct()
NameTypeDescription
$pluginsPathstring

PluginScaffolder::scaffold()

public function scaffold(string $name, string $type = 'Mixed', string $author = 'Milpa Team'): array

Scaffold a new plugin.

Parameters

Parameters of scaffold()
NameTypeDescription
$namestringPlugin name in PascalCase (e.g., "MailPlugin")
$typestringPlugin type: Web, CLI, Mixed, Service
$authorstringAuthor name

Returns

Path to the created plugin and list of generated files

Throws

\RuntimeException If the plugin directory already exists