Drupal
- Use the plugin system (annotations/attributes) for extending entity types, fields, blocks, and more. Use services and dependency injection — define services in `*.services.yml`. Use the Entity API for all data storage and retrieval.
Drupal
- Use the plugin system (annotations/attributes) for extending entity types, fields, blocks, and more. Use services and dependency injection — define services in `*.services.yml`. Use the Entity API for all data storage and retrieval.
- Use render arrays (not raw HTML) for all output — Drupal's render pipeline handles caching, access control, and theming. Use Form API (`FormBase`, `ConfigFormBase`) for forms with built-in CSRF protection. Use `hook_entity_presave()` and event subscribers for business logic. Implement config entities for exportable, deployable configuration. Use Twig templates with `{{ content }}` — never print unfiltered data.