Welcome Guest, Not a member yet? Register   Sign In
Noob Question for Libraries...
#1

[eluser]altrano[/eluser]
Hello,

I have some classes that i builded earlier for symfony projects. and the most of the methods inside are static, the question is how or can i use static libraries in CI? like

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

$this->example::get('somethings');
or must use
Code:
$this->example->get('somethings')

Thanks
#2

[eluser]stuffradio[/eluser]
Can you explain differently? What do you mean?
#3

[eluser]altrano[/eluser]
[quote author="stuffradio" date="1287889538"]Can you explain differently? What do you mean?[/quote]

simply can i use static calls of methods or not, i don't now how to describe diffently,

in symfony many classes or methods in his classes are static

Code:
class Example
{
    public static function get()
    {
        // some code
    }
}

then static call this like
Code:
Example::get();

can i call a method like
Code:
$this->example::get();
instead like
Code:
$this->examlpe->get();
in Controllers or must change methods to

public function get()
Code:
{
    // some code
}
to use it in CI Controllers?

i hope now you better understand my question, sorry my english very bad to describe better.
#4

[eluser]tonanbarbarian[/eluser]
the load->library method will load the library and make an instance of that as an object
however you do not have to then use it that way. the file and class are now loaded by php

so you can simply do this
Code:
$this->load->library('Example');
Example::get();
#5

[eluser]altrano[/eluser]
[quote author="tonanbarbarian" date="1287891748"]the load->library method will load the library and make an instance of that as an object
however you do not have to then use it that way. the file and class are now loaded by php

so you can simply do this
Code:
$this->load->library('Example');
Example::get();
[/quote]


ok thanks for very fast answers.




Theme © iAndrew 2016 - Forum software by © MyBB