Returns the Formatter plugin for a field.
Parameters
string $field_name:
The field name.
Return value
\Drupal\field\Plugin\Type\Formatter\FormatterInterface
If the field is not hidden, the Formatter plugin to use for rendering
it.
File
- drupal/core/modules/entity/lib/Drupal/entity/EntityDisplayInterface.php, line 27
- Contains \Drupal\entity\EntityDisplayInterface.
Class
- EntityDisplayInterface
- Provides an interface defining an entity display entity.
Namespace
Drupal\entity
Code
public function getFormatter($field_name);