1 | <?php |
||
9 | class NameFormatter |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @param $module |
||
14 | * @param $controller |
||
15 | * @param $action |
||
16 | * @return array |
||
17 | */ |
||
18 | public static function formatArray($module, $controller, $action) |
||
19 | { |
||
20 | return [ |
||
21 | 'module' => self::formatModuleName($module), |
||
22 | 'controller' => self::formatControllerName($controller), |
||
23 | 'action' => self::formatActionName($action), |
||
24 | ]; |
||
25 | } |
||
26 | /** |
||
27 | * @param string $name |
||
28 | * @return mixed |
||
29 | */ |
||
30 | 4 | public static function formatModuleName($name) |
|
36 | |||
37 | /** |
||
38 | * @param string $name |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 4 | public static function formatControllerName($name) |
|
47 | |||
48 | /** |
||
49 | * @param $controller |
||
50 | * @return mixed |
||
51 | */ |
||
52 | 4 | protected static function getControllerName($controller) |
|
56 | |||
57 | /** |
||
58 | * @param boolean $name |
||
59 | * @return mixed |
||
60 | */ |
||
61 | 3 | public static function formatActionName($name) |
|
68 | } |
||
69 |