Directory Structure
A complete plugin structure:facturascripts.ini Format
Thefacturascripts.ini file is required for every plugin and defines its metadata.
Basic Configuration
All Available Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Plugin name (must match folder name) |
description | string | Yes | Brief description shown in admin panel |
version | float | Yes | Current plugin version (e.g., 1.0, 2.5) |
min_version | float | Yes | Minimum FacturaScripts version (must be ≥ 2025.0) |
min_php | float | No | Minimum PHP version (default: 8.0) |
require | string | No | Comma-separated list of required plugins |
require_php | string | No | Comma-separated list of required PHP extensions |
Example with Dependencies
Directory Purposes
Controller/
Contains controller classes that handle HTTP requests and business logic. Naming Convention:- File:
Controller/MyController.php - Class:
FacturaScripts\Plugins\YourPlugin\Controller\MyController - URL:
/MyController
Model/
Defines data models that represent database tables. Naming Convention:- File:
Model/MyModel.php - Class:
FacturaScripts\Plugins\YourPlugin\Model\MyModel - Table:
mymodel(lowercase)
Table/
XML files that define database table structure. Naming Convention:- File:
Table/mymodel.xml(lowercase, matches table name)
XMLView/
XML files that define how models are displayed in list and edit views. Naming Convention:- List view:
XMLView/ListMyModel.xml - Edit view:
XMLView/EditMyModel.xml
View/
Custom Twig templates for controllers. Usage:Plugins/YourPlugin/View/MyCustomTemplate.html.twig.
Assets/
Static files (CSS, JavaScript, images) that enhance your plugin’s UI. Structure:Translation/
JSON files containing translations for different languages. Naming Convention:- File:
Translation/{language_code}.json - Examples:
en_EN.json,es_ES.json,ca_ES.json,fr_FR.json
Extension/
Extend or modify core classes without changing core files. Structure:Lib/
Custom helper classes and libraries specific to your plugin. Example:Test/
PHPUnit tests for your plugin. Example:Plugin Loading Order
Plugins are loaded in the order specified by theirorder value in MyFiles/plugins.json. When plugins have dependencies:
- Dependencies are automatically loaded first
- Plugins without dependencies load in alphabetical order
- The
ordervalue is assigned when a plugin is enabled
Deployment Process
When a plugin is enabled or updated, FacturaScripts:- Validates
facturascripts.iniand checks compatibility - Copies assets from
Assets/toMyFiles/Plugins/YourPlugin/Assets/ - Registers routes for all controllers
- Loads translations from
Translation/directory - Executes
Init::update()if present - Rebuilds the database schema from
Table/definitions - Clears cache to ensure fresh data
Best Practices
Follow Conventions
Stick to naming conventions for automatic loading
Organize by Feature
Group related files together in subdirectories
Document Structure
Include a README.md explaining your plugin’s structure
Version Control
Keep Table/ XML files in sync with Model/ classes
Next Steps
Controllers
Learn to create controllers
Models
Work with data models
Views
Design user interfaces

