Skip to content

Instantly share code, notes, and snippets.

@heyMP
Created January 14, 2014 13:04
Show Gist options
  • Save heyMP/8417971 to your computer and use it in GitHub Desktop.
Save heyMP/8417971 to your computer and use it in GitHub Desktop.
Adding a destination parameter on the end of any link with drupal_get_desitnation(). You can add it to the links render array using #options.
$vars['edit_reg'] = array(
'#type' => 'link',
'#href' => 'field-collection/field-event-instance/' . $registration_id . '/edit',
'#title' => 'Edit',
'#alt' => 'Edit registrations.',
'#attributes' => array(
'class' => 'button',
),
'#options' => array('query' => drupal_get_destination()),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment