I\'m trying to retrieve the URL and the Title values of a Link field in Drupal 8.
In my custom controller, I retrieve the nodes with:<
Just to piggyback on the above, if you have an external link,
$node->field_name->uri
Will give you the URL, but if it's an internal you may need to tweak a bit more:
use Drupal\Core\Url; $mylink = Url::fromUri($node->field_name[0]->uri); $mylink->toString();