From eb773b95f08dc79df1acad96296a92a9c71d48f1 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 15 Nov 2024 16:01:05 +0100 Subject: Save registered content functions in class array Modify the Application class so that it keeps an array of all registered content functions and add the method "getContentFunctions" to return it. --- core/namespace/Application.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/namespace') diff --git a/core/namespace/Application.php b/core/namespace/Application.php index 8346248..01c36ac 100644 --- a/core/namespace/Application.php +++ b/core/namespace/Application.php @@ -11,6 +11,7 @@ class Application { private static $Language; private static $Migrator; private static $repositories = []; + private static $contentFunctions = []; #=============================================================================== # Configuration array @@ -224,6 +225,14 @@ class Application { } FunctionParser::register($name, $callback); + self::$contentFunctions[$name] = $callback; + } + + #=============================================================================== + # Return all known content functions + #=============================================================================== + public static function getContentFunctions(): array { + return self::$contentFunctions; } #=============================================================================== -- cgit v1.2.3