Skip to content

Instantly share code, notes, and snippets.

@mjordan
Created January 12, 2014 19:09
Show Gist options
  • Save mjordan/8389001 to your computer and use it in GitHub Desktop.
Save mjordan/8389001 to your computer and use it in GitHub Desktop.
Example Drupal / Islandora preprocess function
<?php
/**
* Preprocess function to format and sanitize output before
* sending it to the template.
*
* @param array &$variables
*/
function template_preprocess_mymodule_hello(&$variables) {
$variables['title'] = check_plain($variables['title']);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment