• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
use paginate() on custom function

#1
Hello,
on my model i create new function returned an array:

public function get_corsi_modulo($tipologia_corsi=null,$id_argomenti=null){
$db = \Config\Database::connect();
$req="SELECT * FROM ".$this->table." where banned='no' and status='si'";
if(!is_null($tipologia_corsi))  $req.=" and tipologia_corsi='".$db->escapeString($tipologia_corsi)."'";
if(!is_null($id_argomenti))  $req.=" and id_argomenti='".$db->escapeString($id_argomenti)."'";
$query = $db->query($req);
$results = $query->getResultArray();
return $results;
}


How i can use the method paginate() on this function?
i try in my controller this:

$CorsiModel->get_corsi_modulo($params['tipologia'],null)->paginate();
but is returned error: 
Call to a member function paginate() on array
Reply


Messages In This Thread
use paginate() on custom function - by pws - 08-10-2020, 03:33 AM
RE: use paginate() on custom function - by pws - 08-10-2020, 06:53 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.