Returns the Widget plugin for a field.
Parameters
string $field_name:
The field name.
Return value
\Drupal\field\Plugin\Type\Widget\WidgetInterface|null
A Widget plugin or NULL if the field does not exist.
File
- drupal/core/modules/entity/lib/Drupal/entity/EntityFormDisplayInterface.php, line 26
- Contains \Drupal\entity\EntityFormDisplayInterface.
Class
- EntityFormDisplayInterface
- Provides an interface defining an entity display entity.
Namespace
Drupal\entity
Code
public function getWidget($field_name);