[eluser]gtech[/eluser]
yes I have tested loading a library in a model and it works, not a good example of echoing content in a model! but just to show it works.
controller (application/controllers/temp.php):
Code:
<?php
class Temp extends Controller {
function Temp()
{
parent::Controller();
}
function index()
{
$this->load->model('tester');
$this->tester->loadlib();
}
}
?>
library (application/libraries/template.php):
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Template {
function dotemplate()
{
echo "library";
}
}
?>
model (application/models/tester.php):
Code:
<?php
class Tester extends Model
{
function Tester()
{
parent::Model();
}
function loadlib()
{
$this->load->library('template');
$this->template->dotemplate();
}
}
?>
to add to what the others have said have you actually loaded the library in the controller to see if it works?