Skip to content

Instantly share code, notes, and snippets.

@paolomainardi
Created August 18, 2012 20:34
Show Gist options
  • Save paolomainardi/3389706 to your computer and use it in GitHub Desktop.
Save paolomainardi/3389706 to your computer and use it in GitHub Desktop.
asdfa
/**
* Helper function for cloning and drupal_render()'ing elements.
*/
function aquaknow_render_clone($elements) {
static $instance;
if (!isset($instance)) {
$instance = 1;
}
foreach (element_children($elements) as $key) {
if (isset($elements[$key]['#id'])) {
$elements[$key]['#id'] = "{$elements[$key]['#id']}-{$instance}";
}
}
$instance++;
return drupal_render($elements);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment