I have the following function used by this cms https://github.com/FoolCode/FoOlSlide:
The line $comics->ilike('name', $search)->limit(20)->get(); searches for the name of the post/manga, but i want to be able to search in other fields too (author for example).
How can i achieve that?
And can someone explain what the "->" in the above code does, or give me a link where it is explained?
Code:
public function search() {
if (!$this->input->post('search'))
{
$this->template->title(_('Search'), get_setting('fs_gen_site_title'));
$this->template->build('search_pre');
return TRUE;
}
$search = HTMLpurify($this->input->post('search'), 'unallowed');
$this->template->title(_('Search'));
$comics = new Comic();
$comics->ilike('name', $search)->limit(20)->get();
foreach ($comics->all as $comic)
{
$comic->latest_chapter = new Chapter();
$comic->latest_chapter->where('comic_id', $comic->id)->order_by('created', 'DESC')->limit(1)->get()->get_teams();
}
$this->template->set('show_sidebar', TRUE);
$this->template->set('search', $search);
$this->template->set('comics', $comics);
$this->template->build('search');
}
The line $comics->ilike('name', $search)->limit(20)->get(); searches for the name of the post/manga, but i want to be able to search in other fields too (author for example).
How can i achieve that?
And can someone explain what the "->" in the above code does, or give me a link where it is explained?