Welcome Guest, Not a member yet? Register   Sign In
using libraries in models
#7

[eluser]Seppo[/eluser]
Oh oh I got it! =)
Are you autoloading the model and loading the library in your constructor? If that's so that's the problem... my code example

The autoload config
Code:
$autoload['model'] = array('testmodel');

The testmodel model
Code:
<?php
class Testmodel extends Model {
    function Testmodel()
    {
        parent::Model();
        $this->do_test();
    }

    function do_test()
    {
        $this->load->library('validation');
        $this->validation->set_fields(array('a' => 'a'));
    }
}
?>


Messages In This Thread
using libraries in models - by El Forum - 05-29-2008, 01:47 PM
using libraries in models - by El Forum - 05-29-2008, 01:52 PM
using libraries in models - by El Forum - 05-29-2008, 02:16 PM
using libraries in models - by El Forum - 05-29-2008, 07:02 PM
using libraries in models - by El Forum - 05-29-2008, 07:54 PM
using libraries in models - by El Forum - 05-29-2008, 08:08 PM
using libraries in models - by El Forum - 05-29-2008, 08:14 PM
using libraries in models - by El Forum - 05-30-2008, 11:18 AM
using libraries in models - by El Forum - 05-30-2008, 11:34 AM
using libraries in models - by El Forum - 06-02-2008, 07:42 AM
using libraries in models - by El Forum - 06-02-2008, 03:30 PM
using libraries in models - by El Forum - 06-02-2008, 10:35 PM
using libraries in models - by El Forum - 06-03-2008, 01:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB