Extract Url & Title from link field in Drupal 8?

后端 未结 11 648
一生所求
一生所求 2021-01-31 05:29

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:<

11条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 05:42

    I just found the solution ...

    $partner->field_lien->uri // The url
    $partner->field_lien->title // The title
    

    My bad, hope it could help someone.

提交回复
热议问题