protected function JsonFeedFields::getAuthor in JSON Feed 8
Retrieve and format author attribute values.
Parameters
int $row_index: The index count of the row as expected by views_plugin_style::getField().
array $options: The full options array which contains author field configurations.
Return value
array An array of author attributes.
1 call to JsonFeedFields::getAuthor()
- JsonFeedFields::render in src/
Plugin/ views/ row/ JsonFeedFields.php - Render a row object. This usually passes through to a theme template of some form, but not always.
File
- src/
Plugin/ views/ row/ JsonFeedFields.php, line 299
Class
- JsonFeedFields
- Plugin which displays fields for a JSON feed.
Namespace
Drupal\json_feed\Plugin\views\rowCode
protected function getAuthor($row_index, array $options) {
return [
'name' => $this
->getField($row_index, $options['author_name_field']),
'url' => $this
->getAbsoluteUrlForField($row_index, $options['author_url_field']),
'avatar' => $this
->getField($row_index, $options['author_avatar_field']),
];
}