Welcome Guest, Not a member yet? Register   Sign In
How to use library in a helper
#1

[eluser]Matthieu Brunet[/eluser]
Hi there,
I want to create a custom helper to manage thumbnail. So in this helper, I will need to use the image library.
What is the best way to load a library in a helper, as I suppose I can't do
$this->load->library("image");

thanks.
#2

[eluser]danmontgomery[/eluser]
[quote author="Matthieu Brunet" date="1264200459"]Hi there,
I want to create a custom helper to manage thumbnail. So in this helper, I will need to use the image library.
What is the best way to load a library in a helper, as I suppose I can't do
$this->load->library("image");

thanks.[/quote]

Code:
$CI =& get_instance();
$CI->load->library("image_lib");

...

$CI->image_lib->resize();
#3

[eluser]Matthieu Brunet[/eluser]
Groovy baby !!

thanks a lot :+)




Theme © iAndrew 2016 - Forum software by © MyBB