Answer the question
In order to leave comments, you need to log in
How to output php function to smarty template?
Can you please tell me how to display this function in the template through smarty?
function getInfoForUser($id) {
global $db;
$user_info_get = $db->fetchRow("select `user_info` from ".TABLE_USERS." where `id`='$id'");
if(!$user_info_get) return 0;
return $user_info_get;
}
$user_info_get = users::getInfoForUser($crt_usr);
$smarty->assign("user_info_get", $user_info_get);
<p>{$user_info_get}</p>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question