V
V
viktorross2019-09-05 12:03:07
PHP
viktorross, 2019-09-05 12:03:07

How to display a function in smarti?

hello, tell me how to output a function from a php file to a template
, I have such a function

function getUser($id, $not_formatted=0) {
    
    global $db;
    global $appearance_settings, $settings;
if(isset($array_users[$i]['user_info']) && $array_users[$i]['user_info']) $array_users[$i]['user_info_formatted']= str_replace("\n", "<br>", $array_users[$i]['user_info']);
}
в файле user.php

there is also a useracc.php file that contains functions like this one, followed by output to the useracc.html template
// saved searches no
if($ads_settings['saved_searches_enabled']) {
  $ss = new saved_searches;
  $no_saved_searches = $ss->getNoSavedSearches($crt_usr);
  $smarty->assign("no_saved_searches",$no_saved_searches);
}

How can I add this function to the template?

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