| @@ 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. |
|
| @@ 751-764 (lines=14) @@ | ||
| 748 | } |
|
| 749 | } |
|
| 750 | ||
| 751 | public static function findFieldClass($method) |
|
| 752 | { |
|
| 753 | $className = __NAMESPACE__.'\\Form\\Field\\'.ucfirst($method); |
|
| 754 | ||
| 755 | if (class_exists($className)) { |
|
| 756 | return $className; |
|
| 757 | } |
|
| 758 | ||
| 759 | if ($method == 'switch') { |
|
| 760 | return __NAMESPACE__.'\\Form\\Field\\SwitchField'; |
|
| 761 | } |
|
| 762 | ||
| 763 | return false; |
|
| 764 | } |
|
| 765 | ||
| 766 | /** |
|
| 767 | * Render the contents of the form when casting to string. |
|