public Registry::getPrefixGroupedUserFunctions()
Gets all user functions grouped by the word before the first underscore.
Return value
array Functions grouped by the first prefix.
File
- core/lib/Drupal/Core/Theme/Registry.php, line 750
Class
- Registry
- Defines the theme registry service.
Namespace
Drupal\Core\Theme
Code
public function getPrefixGroupedUserFunctions() { $functions = get_defined_functions(); $grouped_functions = []; // Splitting user defined functions into groups by the first prefix. foreach ($functions['user'] as $function) { list($first_prefix, ) = explode('_', $function, 2); $grouped_functions[$first_prefix][] = $function; } return $grouped_functions; }
Please login to continue.