Posted By

kfiil on 04/11/11


Tagged

drupal theme theming drupal6


Versions (?)

Drupal: phptemplate_preprocess


 / Published in: PHP
 

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

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

  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. }

Report this snippet  

You need to login to post a comment.