How to call my static function with parameters in the twig template 3.0 without going through the controller?
For exemple:
{{ Helper::url('/link') }}
My Static Class:
public static function url(string url) {
$host = $_SERVER['HTTP_HOST'] == 'localhost' ? URL_TEST : URL_BASE;
if (str_starts_with($url, '/')):
return $host . $url;
endif;
return $host . '/' . $url;
}
}