Score:2

How to get webform url object, if I have webform machine name and webform path

uz flag

I have webform path and webform machine name, how can I get url object of this webform?

Score:4
cn flag

You can use the same route as for other entities: $webform_url = Url::fromRoute('entity.webform.canonical', ['webform' => 'my_webform_id']);

ru flag
This is NOT a [Symfony route object](https://github.com/symfony/routing/blob/6.2/Route.php), this is a [Drupal\Core\Url](https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Url.php/class/Url/10) object. If this is the accepted answer, then the question is about URL objects, not route objects.
EvilArgest avatar
uz flag
@Hudri Edited the question due to your remark.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.