search_terms = $search_terms; } /** * @param Image[] $images */ public function display_page(Page $page, array $images): void { $page->title = "Random Posts"; $html = "Refresh the page to view more posts"; if (count($images)) { $html .= "
"; foreach ($images as $image) { $html .= $this->build_thumb_html($image); } $html .= "
"; } else { $html .= "

No posts were found to match the search criteria"; } $page->add_block(new Block("Random Posts", $html)); $nav = $this->build_navigation($this->search_terms); $page->add_block(new Block("Navigation", $nav, "left", 0)); } /** * @param string[] $search_terms */ protected function build_navigation(array $search_terms): string { $h_search_string = html_escape(Tag::implode($search_terms)); $h_search_link = make_link("random"); $h_search = "

"; return $h_search; } }