You are here

function smart_title_entity_view in Smart Title 8

Implements hook_entity_view().

File

./smart_title.module, line 92
Contains hooks and private functions of smart_title.module.

Code

function smart_title_entity_view(&$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
  if (!$entity
    ->isNew() && $display
    ->getThirdPartySetting('smart_title', 'enabled') && $display
    ->getComponent('smart_title')) {
    \Drupal::classResolver()
      ->getInstanceFromDefinition(SmartTitleBuilder::class)
      ->buildView($build, $entity, $display);
  }
}