Welcome Guest, Not a member yet? Register   Sign In
how to work with library like this?
#1

[eluser]Unknown[/eluser]
Dear friends, i'm from Brazil and i started yesterday with CI, ther is a fantastic framework, but a have a question, some one can help me?

My website need to use a Youtube videos, so i have to use the embed code on some time, then a want to create a library to work on entire website, but a always get a error.

1) Can i call a library from a view?

my code:

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Classtest {

    function some_function()
    {
        echo "teste";
    }
}

?>

and a call it on a view

Code:
$this->load->library('Classtest');
$this->Classtest->some_function();

but a have this error:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$Classtest
Filename: views/home.php
Line Number: 145

Can anyone help me please?
Sorry for my english!


Messages In This Thread
how to work with library like this? - by El Forum - 01-16-2010, 06:21 AM
how to work with library like this? - by El Forum - 01-16-2010, 06:45 AM
how to work with library like this? - by El Forum - 01-16-2010, 07:33 AM
how to work with library like this? - by El Forum - 01-16-2010, 06:26 PM
how to work with library like this? - by El Forum - 01-17-2010, 12:16 AM
how to work with library like this? - by El Forum - 01-17-2010, 10:27 AM
how to work with library like this? - by El Forum - 01-17-2010, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB