__construct()

public function __construct(?string $module_name = null)

Description

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

Note: The framework automatically instantiates Trongate_security via $this->trongate_security. 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 manage() {
        // $this->trongate_security is automatically an instance
        $this->trongate_security->make_sure_allowed('admin panel');
    }
}

// Manual instantiation (rare)
$security = new Trongate_security('products');