Hello,
Is it possible to bind parameters in 'OrderBy' while using Paginator?
Currently i use something like this:
$orderBy = $this->request->getQuery('order'); // rank/price
$sortBy = $this->request->getQuery('sort'); // ASC/DESC
$Domains = $this->modelsManager->createBuilder()
->from('Core\Models\Domains')
->orderBy($orderBy . ' ' . $sortBy);
$currentPage = $this->request->getQuery('page', 'int');
$paginator = new Paginator(
array(
"builder" => $Domains,
"limit" => 10,
"page" => $currentPage
)
);
Thanks.