<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ngekoding / codeigniter-api-query-parser example snippets
// CodeIgniter 3 Example
// Get a query builder
// Please note: we don't need to call ->get() here
$queryBuilder = $this->db->select('p.*, c.name category')
->from('posts p')
->join('categories c', 'c.id=p.category_id');
/**
* The first parameter is the query builder instance
* and the second is the codeigniter version (3 or 4)
*/
$queryParser = new \Ngekoding\CodeIgniterApiQueryParser\QueryParser($queryBuilder);
$result = $queryParser->applyParams(); // done
print_r($result);