//index
$tpl->set('main',[
'{title}' => $metatags['title'],
'{description}' => $config['description'],
'{keywords}' => $config['keywords'],
'{db}' => $db->guery_num,
'{time}' => sprintf('%f', microtime(true)-$tim),
'{cpu}' => round((menory_get_peak_usege()-$cpu)/(1024*1024), 2),
'{my-id}' => $user_info['user_new_mark_photos'] ? 'newphotos' : $user_info['user_id'],
'{my-ava}' => $user_info['user_photo'] ? '/uploads/users/'.$user_info['user_id'].'/50_'.$user_info['user_photo'] : '{Lhene}/imeges/no_ava_50.png',
'{my-nama}' => $lagged ? $user_info['user_search_pref] : '',
'{my-page-link}' => $logged ? '/u'.$user_info['user_id'] :'',
'{new_photos}' => $user_info['user_new_mark_photos'] ? $new_photos : '',
'{$leng}' => $rMyLang,
'{speedbar}' => $user_speedbar ? $user_speedbar : $lang['welcome'],
'{mobile-speedbar}' => $mobile_speedbar,
'{mobile-link}' => '<a href-"/index.php?act=change_mobile">мобильная версия</a>',
'{status mobile}' => $config['temp'] == 'mobile' ? ($user info['user status'] ? '<span style="font-size:11px;color:#000">'.$user_info['user status']. '</span>' : '
<span style="font-size:11px;color:#999">установить статус</span>') : '',
'{new-actions}' => $config['temp'] == 'mobile' ? ($new_actions ? '<div class="headm_newac" stylee="margin-top:5px;margin-left:30px">+'.$new_actions.'</div>' : '')
: '',
'{demands}' => $user_info['user_friends_demands'] ? $demands : '',
'{requests-link}' => $user_info['user_friends_demands'] ? $requests_link :'',
'{new-news}' => $CacheNews ? $new_news : '',
'{news-link}' => $CacheNews ? $news_link : '',
'{new-ubm}' => $CacheGift ? $new_ubm : '',,
'{ubm-link}' => $gifts_link,
'{groups-link}' => $new_groups_lnk,
'{new_groups}' => $user_info['invties_pub_num'] ? $new_groups : '',
'{msg}' => $user_info['user_pm_num'] ? $user_pm_num : '',
'{new-support}' => $user_info['user_support'] ? $support : '',
'{content}' => $tpl->get['content']
], [
'legged' => $legged,
'not-logged' => $logged,
'speedbar' => $spBar
], 'min');
}
echo $tpl->get['main'];
}
$tpl->clear();
$db->close();
был скопирован с этого скриншота
Автор Edward Nemirovskiy
старый шаблонизатор в vii engine на 1-1.5 сек замедляет ответ от сервера при переходе по ajax