function index($offset = 0) { $inventoryObject = new Inventory(); $inventoryObject->limit($offset, 20)->get(); $data = $inventoryObject->all_to_array(); $this->load->view("stock", $data); }