I am writing my first Slim 3 application.
To render templates PHP-View, not Twig, is used, by choice.
I want to implement global helper functions.
They are contained in single file and are autoloaded like so:
They should be accessible from templates.
Here is one example:
function trans($id = null, $replace = , $locale = null)
I used Laravel before, and a similar concept is used by Laravel’s helpers.php.
As you can see from the link above, trans(), and other functions depend on the container components. However, in Slim3 there is no way to access it directly.
How can this be implemented in Slim3?