ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ClassNameToScreenId.php
Go to the documentation of this file.
1<?php
2
19declare(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)