public function AddToGoogle::generateUrl in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToGoogle::generateUrl()
- 10.3.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToGoogle::generateUrl()
- 10.0.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToGoogle::generateUrl()
- 10.1.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToGoogle.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToGoogle::generateUrl()
Returns the 'Add to calendar' link.
Parameters
\Drupal\node\NodeInterface $node: The node entity.
Return value
\Drupal\Core\Url Url object.
Overrides SocialAddToCalendarBase::generateUrl
File
- modules/
social_features/ social_event/ modules/ social_event_addtocal/ src/ Plugin/ SocialAddToCalendar/ AddToGoogle.php, line 23
Class
- AddToGoogle
- Provides add to Google calendar plugin.
Namespace
Drupal\social_event_addtocal\Plugin\SocialAddToCalendarCode
public function generateUrl(NodeInterface $node) {
$settings = $this
->generateSettings($node);
$options = [
'query' => [
'action' => 'TEMPLATE',
'text' => $settings['title'],
'dates' => $settings['dates']['both'],
'ctz' => $settings['timezone'],
'details' => $settings['description'],
'location' => $settings['location'],
],
'attributes' => [
'target' => '_blank',
],
];
return Url::fromUri($this->pluginDefinition['url'], $options);
}