You are here

public function AddToICal::generateUrl in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToICal.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToICal::generateUrl()
  2. 10.3.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToICal.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToICal::generateUrl()
  3. 10.0.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToICal.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToICal::generateUrl()
  4. 10.1.x modules/social_features/social_event/modules/social_event_addtocal/src/Plugin/SocialAddToCalendar/AddToICal.php \Drupal\social_event_addtocal\Plugin\SocialAddToCalendar\AddToICal::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/AddToICal.php, line 25

Class

AddToICal
Provides add to iCal calendar plugin.

Namespace

Drupal\social_event_addtocal\Plugin\SocialAddToCalendar

Code

public function generateUrl(NodeInterface $node) {
  $settings = $this
    ->generateSettings($node);
  $options = [
    'query' => $settings,
    'attributes' => [
      'target' => '_blank',
    ],
  ];
  return Url::fromRoute($this->pluginDefinition['url'], [], $options);
}