Controller
in package
AbstractYes
Abstract Class Controller
- Base controller that all application controllers must extend.
- Handles common initialization tasks such as Session start and Translation loading.
- Provides the 'render' method to generate views.
Table of Contents
Properties
- $trans : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor.
- render() : void
- Renders a view file within a layout template.
Properties
$trans
protected
array<string|int, mixed>
$trans
= []
Holds translation strings for the current language.
Methods
__construct()
Constructor.
public
__construct() : mixed
Ensures session is started and loads translations based on user preference.
render()
Renders a view file within a layout template.
public
render(string $file[, array<string|int, mixed> $data = [] ][, string $template = 'default' ]) : void
Parameters
- $file : string
-
The name of the view file (without .php extension).
- $data : array<string|int, mixed> = []
-
Associative array of data to pass to the view.
- $template : string = 'default'
-
The layout template to use (default: 'default').