| @@ 742-755 (lines=14) @@ | ||
| 739 | } |
|
| 740 | } |
|
| 741 | ||
| 742 | public static function findFieldClass($method) |
|
| 743 | { |
|
| 744 | $className = __NAMESPACE__.'\\Form\\Field\\'.ucfirst($method); |
|
| 745 | ||
| 746 | if (class_exists($className)) { |
|
| 747 | return $className; |
|
| 748 | } |
|
| 749 | ||
| 750 | if ($method == 'switch') { |
|
| 751 | return __NAMESPACE__.'\\Form\\Field\\SwitchField'; |
|
| 752 | } |
|
| 753 | ||
| 754 | return false; |
|
| 755 | } |
|
| 756 | ||
| 757 | /** |
|
| 758 | * Render the contents of the form when casting to string. |
|
| @@ 122-135 (lines=14) @@ | ||
| 119 | * @param string $method |
|
| 120 | * @return bool|string |
|
| 121 | */ |
|
| 122 | public static function findFieldClass($method) |
|
| 123 | { |
|
| 124 | $className = "\\Encore\\Admin\\Form\\Field\\".ucfirst($method); |
|
| 125 | ||
| 126 | if (class_exists($className)) { |
|
| 127 | return $className; |
|
| 128 | } |
|
| 129 | ||
| 130 | if ($method == 'switch') { |
|
| 131 | return '\\Encore\\Admin\\Form\\Field\\SwitchField'; |
|
| 132 | } |
|
| 133 | ||
| 134 | return false; |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * Add a form field to form. |
|