Welcome Guest, Not a member yet? Register   Sign In
Access to libray or model from another model

Hello people. I am sorry for my bad english. But I have a question. Can I load the library or model from another model?

This error
"A PHP Error was encountered
Severity: Notice
Message: Undefined property: Files_model::$catalog
Filename: models/files_model.php
Line Number: 9
Fatal error: Call to a member function set_cat_type() on a non-object in D:\server\www\lehe\core\application\models\files_model.php on line 9"
appears when I tryed to execute this code:

class Files_model extends Model
    function __construct()

        function get_file_list()    
                return $this->catalog->get_catalog_list();

          . . . . . .

Models have problems with accessing libraries and such, use the CI instance instead:
$CI =& get_instance();

Thank you. It is working! =)

Theme © iAndrew 2016 - Forum software by © MyBB