ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ClassNameToScreenId.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  private static string $REGEX = '/il(Object|Obj|)(.*)GUI/mi';
26 
27  protected function classNameToScreenId(string $classname): ?string
28  {
29  $classname = preg_replace(self::$REGEX, "$2", $classname);
30  $classname = $this->snakeToCamel($classname);
31 
32  return $classname;
33  }
34 
35  protected function snakeToCamel(string $command): string
36  {
37  return strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $command));
38  }
39 }
classNameToScreenId(string $classname)