__construct()

public function __construct(?string $module_name = null)

Description

Constructor for the Trongate base controller. Sets the module name for the current controller instance. If no module name is provided, auto‑detects from the class name (e.g., a class named Products becomes module products).

Note: The framework automatically passes the module name when instantiating controllers via URL routing. You only need to call the constructor manually when creating controller instances programmatically.

Parameters

Parameter Type Description Default Required
module_name string|null The module name for this controller instance. If null, derived from the class name. null No

Return Value

Type Description
void Constructor does not return a value.

Example Usage