Use for: building or extending Dolibarr modules (external/custom), implementing hooks, triggers, DAO classes, SQL tables, menus, permissions, tabs, boxes, PDF templates, cron scripts.
Covers both core contributor and external module developer workflows.
Applies coding rules (PSR-12, SQL norms, MVC pattern, Active Record).
Stronger alternatives
This repository is archived — consider an actively maintained alternative.
Following Dolibarr coding rules (PHP, SQL, HTML norms)
Key Concepts
Architecture
MVC pattern: Controller (/ Actions /) + View (/ View /) in same PHP file
Active Record ORM: one class per table with CRUD methods
Global objects: $db, $user, $conf, $langs, $mysoc, $hookmanager, $extrafields
Module location: external modules live in htdocs/custom/mymodule/
Table prefix: all tables prefixed llx_
Module Entry Points
Extension point
When to use
Hooks
Inject/replace code in existing pages without modifying core
Triggers
React to business events (invoice created, order validated…)
Tabs
Add tabs on thirdparty, order, product, invoice… sheets
Menus
Add top-level or left-menu entries
Boxes
Add widgets on home page
Extrafields
Add fields to existing objects (no module needed for simple cases)
PDF templates
Customize generated PDF documents
Step-by-Step: Build a Module
1. Generate Skeleton
Use the built-in Module Builder (enable it in Setup → Modules, then click the bug icon top-right). It generates modMyModule.class.php, SQL files, DAO class, and page skeletons.