Drupal: phptemplate_preprocess


/ Published in: PHP
Save to your folder(s)

Implementation of phptemplate_preprocess. Enables that preprocess functions are in different files


Copy this code and paste it in your HTML
  1. /**
  2.  * Implementation of phptemplate_preprocess()
  3.  *
  4.  * This function checks to see if a hook has a preprocess file associated with it, and if so, loads it.
  5.  *
  6.  * @param $vars
  7.  * @param $hook
  8.  */
  9. function fremtidslaboratoriet_preprocess(&$vars, $hook)
  10. {
  11. //DEBUG
  12. //dpm($hook);
  13. $preprocessFunction = drupal_get_path('theme', 'fremtidslaboratoriet') . '/preprocess/preprocess-' . str_replace('_', '-', $hook) . '.inc';
  14.  
  15. if(is_file($preprocessFunction))
  16. {
  17. include($preprocessFunction);
  18. //DEBUG
  19. //dpm($preprocessFunction);
  20. }
  21. }

URL: Implementation of phptemplate_preprocess. Enables that preprocess functions are in different files

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.