Custom Templates
Customize code generation templates to match your teamβs conventions.
Configuration
# config/packages/hexagonal_maker.yaml
hexagonal_maker:
skeleton_dir: '%kernel.project_dir%/config/skeleton'
Template Structure
config/skeleton/
βββ src/Module/
βββ Domain/
β βββ Model/
β βββ Entity.tpl.php
βββ Application/
β βββ Command/
β βββ CommandHandler.tpl.php
βββ ...
Example Custom Template
<?= "<?php\n" ?>
declare(strict_types=1);
namespace <?= $namespace ?>;
// Your custom headers, comments, etc.
final class <?= $class_name ?>
{
// Your custom template logic
}
Template Variables
Available variables depend on the maker. Common ones:
$namespace- Full namespace$class_name- Class name$module- Module path$entity_name- Entity name
See default templates in vendor/ahmed-bhs/hexagonal-maker-bundle/src/Resources/skeleton/