0
我有這個模型在我的笨設置:笨的RESTful API - 如何獲得參數
function get_all_artists(){
$this->db->select('artist_id, artist_name');
$this->db->from('artists');
return $this->db->get();
}
如何抓在我的Rest_Controller設置這些參數? _get()
功能將如何顯示?
public function artists_get()
{
???
}
在此先感謝
你要訪問返回的結果所以
$this->db->get()->result_array();
從模型中檢索數據'get_all_artists()'函數? –你的意思是從你的控制器調用該函數? $這 - >負載>模型( 'MODEL_NAME'); '$ artists = $ this-> model_name-> get_all_artists(); – Dan
是的,我需要從結果 – SHT