You are here

public function RestfulEntityViewMode::renderField in RESTful 7

Helper function to get the rendered field for the output.

Parameters

\EntityDrupalWrapper $wrapper: The entity wrapper.

string $field_name: The field name to render.

string $view_mode: The view mode to use.

Return value

mixed The output value to be rendered.

File

includes/RestfulEntityViewMode.php, line 126
Contains \RestfulEntityViewMode

Class

RestfulEntityViewMode
@file Contains \RestfulEntityViewMode

Code

public function renderField(\EntityDrupalWrapper $wrapper, $field_name, $view_mode) {
  $render_element = $this
    ->getEntityRenderElement($wrapper, $view_mode);
  return drupal_render($render_element[$field_name]);
}