By mahnaz.afshar on
Hi.There is one variable in template.php and i want to pass this variable to tpl.php of my view.
in templat :
function bartik_preprocess_views_view(&$var)
{
$var['test']="1";
dpm($var['test']);
}
in tpl.php :
print "variable test is".$test;
please guide me
Comments
Hello,
Hello,
in template.php write below code
function YOURTHEMENAME_preprocess_views_view(&$vars) {
$vars['test'] = 'My test';
}
in tpl.php write:
print $test;