__construct()
public function __construct()
Description
Constructor for the File module. Blocks direct URL access to the module for security.
Note: The framework automatically instantiates File via $this->file. You rarely need to call this constructor manually.
Parameters
This constructor accepts no parameters.
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 upload() {
// $this->file is automatically a File instance
$result = $this->file->upload($_FILES['picture']);
}
}
// Manual instantiation (rare)
$file = new File();