I created a custom module and there is a simple hello_world()
function. Is it possible to call this function in the page template file?
Module file looks like this.
function choco_custom_newui_total_students(){
return 500;
}
function choco_custom_newui_preprocess_page(&$variables) {
$variables['total_students'] = total_students();
}
page--front.tpl.php
<h2><? echo $total_students?></h2>
choco_custom_newui_total_students()
but nottotal_students()
choco_custom_newui
is the module name. [2] see ifchoco_custom_newui
module has been enabled. [3] runprint 'stop here'; exit;
and refresh the page to see if the preprocess function is really being implemented.