diff options
author | Thomas Lange <code@nerdmind.de> | 2024-11-15 16:01:05 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2024-11-15 16:10:56 +0100 |
commit | eb773b95f08dc79df1acad96296a92a9c71d48f1 (patch) | |
tree | 1339a395c8645b4869be1951e924a3c698e672c7 | |
parent | 7a6c176759a7b5bf6924447afb9f10f615c52563 (diff) | |
download | blog-eb773b95f08dc79df1acad96296a92a9c71d48f1.tar.gz blog-eb773b95f08dc79df1acad96296a92a9c71d48f1.tar.xz blog-eb773b95f08dc79df1acad96296a92a9c71d48f1.zip |
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.
-rw-r--r-- | core/namespace/Application.php | 9 |
1 files changed, 9 insertions, 0 deletions
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; } #=============================================================================== |