2

I am a beginner of drupal 7. I create a new theme and write a preprocess function at template.php:

function mytheme_preprocess_page(&$vars){
  $vars[my_var]=array('var_0', 'var_1', 'var2');
}

How should I access $vars[my_var] at page.tpl.php?

Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105
solomon_wzs
  • 1,711
  • 5
  • 16
  • 29

1 Answers1

3

Inside the page template, e.g. page.tpl.php just type:

print $my_var['var_0'];

Hope this works... Muhammad.

Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105