V
V
viktorross2019-09-05 13:49:28
PHP
viktorross, 2019-09-05 13:49:28

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;

  }

tried like this
$user_info_get = users::getInfoForUser($crt_usr);
$smarty->assign("user_info_get", $user_info_get);

<p>{$user_info_get}</p>
does not work

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question