Skip to content
Snippets Groups Projects
Commit 8c00b9aa authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Fixed code style.

parent dcfe1b03
Branches 8.x-1.x
Tags 3.0.0-alpha0 3.0.0-alpha1 8.x-2.0-beta1
No related merge requests found
......@@ -102,30 +102,30 @@ abstract class FieldFormatterBase extends EntityReferenceFormatterBase {
$entityUrl = $entity->toUrl();
/*
TODO: This implementation overwrites the ['#url'] value of the
selected field, which only works for fields what support
['#url'] and has the advantage that no extra wrapper is created
AND links in links are prevented. Anyway this will not work for
all field types.
TODO: This implementation overwrites the ['#url'] value of the
selected field, which only works for fields what support
['#url'] and has the advantage that no extra wrapper is created
AND links in links are prevented. Anyway this will not work for
all field types.
*/
foreach ($entityDisplay as $field_name => &$field) {
$field[0]['#url'] = $entityUrl;
}
/*
TODO: Alternative from field_link formatter, which should
work for all field types but may lead to links in links
and additional wrapper markup.
$field_name = $this->fieldDefinition->getName();
$field_output = isset($entityDisplay[$field_name]) ?
$entityDisplay[$field_name] : [];
foreach (Element::children($field_output) as $key) {
$entityDisplay[$field_name][$key] = [
'#type' => 'link',
'#url' => $entityUrl,
'#title' => $field_output[$key],
];
}
TODO: Alternative from field_link formatter, which should
work for all field types but may lead to links in links
and additional wrapper markup.
$field_name = $this->fieldDefinition->getName();
$field_output = isset($entityDisplay[$field_name]) ?
$entityDisplay[$field_name] : [];
foreach (Element::children($field_output) as $key) {
$entityDisplay[$field_name][$key] = [
'#type' => 'link',
'#url' => $entityUrl,
'#title' => $field_output[$key],
];
}
*/
}
$build[$delta] = $entityDisplay;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment