You are here

function easy_social_example_preprocess_easy_social_example in Easy Social 8.4

Same name and namespace in other branches
  1. 8.3 contrib/easy_social_example/easy_social_example.module \easy_social_example_preprocess_easy_social_example()

Implements hook_preprocess_HOOK() for easy_social_example theme.

See also

easy_social_theme()

theme_easy_social_example()

File

contrib/easy_social_example/easy_social_example.module, line 49
Easy Social Example module.

Code

function easy_social_example_preprocess_easy_social_example(&$variables) {

  // You can still pre-process this as usual.
  // Notice that the config settings have been automatically added.
  $options = array();
  $options['attributes']['class'] = array(
    'class' => 'example-share-button',
  );
  $url = Url::fromUri('http://www.example.com/share', $options);
  $example_share_link = \Drupal::l(t('Example share'), $url);
  $variables['example_share_link'] = $example_share_link;
}