CodeIgniter Forums
Multiple load of Library. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: Multiple load of Library. (/thread-4473.html)



Multiple load of Library. - El Forum - 11-27-2007

[eluser]MikeVrind[/eluser]
Hello,

I'm just started with CI but I have a question that I couldn't find on the website.

I have put the TemplatePower class as a library into CI but I need to load 2 different template files.

With normal coding I always used 2 different vars to load TemplatePower in.
But how must I do this while using CI?

I use the next code to load the library:
Code:
<?php
    
    $this->load->library('TemplatePower', $_COOKIE['taalPath'].'/About.tpl');
    
    $this->templatepower->prepare();
    
    $this->templatepower->newBlock('About');
    
    $this->templatepower->printToScreen(); <br />

?&gt;

Sorry for the bad language, but I'm not English.


Multiple load of Library. - El Forum - 11-27-2007

[eluser]nmweb[/eluser]
After loading the library for the first time I think you can simply do $var=new TemplatePower; The library is simply included the first time so it should work. It works like this in Kohana and CI and Kohana aren't that different.

Groetjes,