0
我已經將普通的PHP類轉換爲庫,以便我可以在Codeigniter中將它用作庫。我可以加載它並調用我在該類中需要的函數。 Here is that class to help with the question。從庫調用模型函數
但是,我不得不在我的班級中調用函數。這些函數駐留在實例化我的類的模型中。我目前的普通電話無法工作,我該如何做到這一點。這裏是我的代碼:
class Controlpanel_model extends Model {
var $category = '';
var $dataa = 'a';
function Controlpanel_model(){
parent::Model();
}
function import_browser_bookmarks(){
$this->load->library('BookmarkParser');
/*
*In this function call to the class I pass
* what model functions exist that it should call
* You can view how this done by clicking the link above and looking at line 383
*/
$this->bookmarkparser->parseNetscape("./bookmarks.html", 0, 'myURL', 'myFolder');
return $this->dataa;
}
function myURL($data, $depth, $no) {
$category = $this->category;
$this->dataa .= 'Tag = '.$category.'<br />'.'URL = '.$data["url"].'<br />'.'Title = '.$data["descr"].'<br />'.'<br /><br />';
}
function myFolder($data, $depth, $no) {
$this->category = $data["name"];
}
}
感謝所有的任何幫助。
完美 - 正是我期待的! – Abs 2010-03-29 14:24:56