<ul class="pagination pagination-sm pull-right"> <?php echo Pagination::instance('pagination')->pages_render(); ?> </ul>
$data['contacts'] = Model_Contact::query()->rows_offset($pagination->offset)->rows_limit($pagination->per_page)->order_by($order)->get();
$data['contacts'] = Model_Contact::search(Input::post('search'), $fuzzy);
Snippet from model_contact::search
<?php public static function search($pattern, $fuzzy=false)
{
if(Auth::member(100)) {
if($fuzzy) {
$result = Model_Contact::find('all', array(
'where' => array(array('email', 'LIKE', "%$pattern%"), 'or' => array(array('name', 'LIKE', "%$pattern%"),),'or' => array(
array('forename', 'LIKE', "%$pattern%"),),),))->rows_offset(\Pagination::get('offset'))->rows_limit(\Pagination::get('per_page'))->get();
} else {
$result = Model_Contact::find('all', array(
'where' => array(array('email', 'LIKE', "%$pattern%"), 'or' => array(array('name', 'LIKE', "%$pattern%"),),),));
}
?>
It looks like you're new here. If you want to get involved, click one of these buttons!