In a Drupal 8.3 View, I am displaying fields. One of these fields is configured to "rewrite results" so as to "output this field as a custom link" with a custom link path.
I would like to modify these links in code (based on some later logic). However, I cannot find a place to actually modify this value in code. If someone knows how to accomplish this, please let me know. (This was much easier in D7.)
Here's what I've tried thus far.
theme_preprocess_views_view()
: I found...['#view'] -> field['name'] -> options['alter']['path']
in Drupal 8's endless arrays, but changing this value did not affect the output. I could not find my custom link anywhere else in this endless array.hook_views_post_render()
: This supposedly allows one to alter the output string, but doesn't actually give the output as a string (broken documentation).- I can see the output string in a twig template, but cannot easily substitute my link given that PHP doesn't run in twig. This would be a less desirable option in any case.