__construct()

public function __construct(?string $module_name = null)

Description

Constructor for the Templates module. Calls parent constructor and blocks direct URL access.

Note: The framework automatically instantiates Templates via $this->templates. You rarely need to call this constructor manually.

Parameters

Parameter Type Description Default Required
module_name string|null The module name (passed by framework for integration with Trongate module system). null No

Return Value

Type Description
void Constructor does not return a value.

Example Usage

PHP
<?php
// Automatic instantiation by framework (inside a controller)
class Products extends Trongate {
    public function index() {
        // $this->templates is automatically a Templates instance
        $this->templates->admin($data);
    }
}

// Manual instantiation (rare)
$templates = new Templates('products');