get('user')); $posts[] = generatePostItemTemplate($Post, $User); } catch(Post\Exception $Exception){} catch(User\Exception $Exception){} } } } #=============================================================================== # Build document #=============================================================================== $SearchTemplate = Template\Factory::build('post/search'); $SearchTemplate->set('QUERY', $search); $SearchTemplate->set('POSTS', $posts ?? []); $MainTemplate = Template\Factory::build('main'); $MainTemplate->set('NAME', $Language->text('title_post_search')); $MainTemplate->set('HTML', $SearchTemplate); echo $MainTemplate;