You are not logged in.
Pages: 1
Hi everyone,
I'm trying to import a library/model I have developed in an old CI project. But I am having trouble getting it to work.
The classe's filename is is
list_model.php
I have placed it in the application/libraries folder, and modified it so it begins like:
<?php
class List_model {
//var $variable;
//var $variable;
/**
*
*
*
*/
public static function email_attachment($address,$subject='HI', $attachment_path=NULL) {I have also changed most of the classes functions to public static. In my controller though when I call a function from this class ( e.g.
$result =list_model::safe_csv($filepath, $data);, I get :
Message:
Class 'list_model' not found
Can anyone give me a hand with this.
Thank you,
Bill
Last edited by bill (2012-10-26 03:02:08)
Offline
Offline
you must call the class like this: "List_model::safe_csv"
PHP *something* *something* uppercase *something* ( yea.. F**k my English..)
Thanks and sorry for my poor English
-- Tuna Abutbul.
Offline
Syropian, you're partly right. Underscores are treated as directory separators, so List_Model becomes libraries/list/model.php. Alternatively you could map all the classes using the Autoloader::map function.
-- Phill Sparks ( Code | Bundles )
Offline
Thanks guys, Its working now.
Regards,
Bill
Offline
Pages: 1