ページングを使用してWebサービスからデータを取得する方法は?今のところ私はデータを表示することができます。しかし、私は改ページを行うことはできません。 私はcurlライブラリでcodeigniter 3.0.6を使用しています。これは私がREST APIを作るために使用するものである:codeigniterからデータを取得するページ番号付きのREST API(Webサービス)
function index_get($limit = 100, $offset = 0) {
$MhswID = $this->get('MhswID');
if ($MhswID == '') {
$mhsw = $this->db->get('mhsw', $limit, $offset)->result();
} else {
$this->db->where('MhswID', $MhswID);
$mhsw = $this->db->get('mhsw', $limit, $offset)->result();
}
$this->response($mhsw, 200);
}
し、データを取得するために、これは次のとおりです。
function __construct() {
parent::__construct();
$this->API="http://admin:[email protected]/ci3_rest/index.php";
}
// menampilkan data mahasiswa
function index($limit = "", $offset = ""){
$data['mahasiswa'] = json_decode($this->curl->simple_get($this->API.'/mahasiswa'));
$this->load->view('welcome_message',$data);
}
詳細を入力してコードを表示してください。 – parth
編集済み@parth。チェックしてください。 – heruprambadi