| @@ 145-158 (lines=14) @@ | ||
| 142 | * |
|
| 143 | * @return bool|string |
|
| 144 | */ |
|
| 145 | public static function findFieldClass($method) |
|
| 146 | { |
|
| 147 | $className = '\\Encore\\Admin\\Form\\Field\\'.ucfirst($method); |
|
| 148 | ||
| 149 | if (class_exists($className)) { |
|
| 150 | return $className; |
|
| 151 | } |
|
| 152 | ||
| 153 | if ($method == 'switch') { |
|
| 154 | return '\\Encore\\Admin\\Form\\Field\\SwitchField'; |
|
| 155 | } |
|
| 156 | ||
| 157 | return false; |
|
| 158 | } |
|
| 159 | ||
| 160 | /** |
|
| 161 | * Add a form field to form. |
|
| @@ 856-869 (lines=14) @@ | ||
| 853 | } |
|
| 854 | } |
|
| 855 | ||
| 856 | public static function findFieldClass($method) |
|
| 857 | { |
|
| 858 | $className = __NAMESPACE__.'\\Form\\Field\\'.ucfirst($method); |
|
| 859 | ||
| 860 | if (class_exists($className)) { |
|
| 861 | return $className; |
|
| 862 | } |
|
| 863 | ||
| 864 | if ($method == 'switch') { |
|
| 865 | return __NAMESPACE__.'\\Form\\Field\\SwitchField'; |
|
| 866 | } |
|
| 867 | ||
| 868 | return false; |
|
| 869 | } |
|
| 870 | ||
| 871 | /** |
|
| 872 | * Render the contents of the form when casting to string. |
|