Welcome Guest, Not a member yet? Register   Sign In
using a class from phpclasses.org
#1

[eluser]rakesh[/eluser]
hi,

i wished to use a class from phpclasses.org called snapsalbum (http://www.phpclasses.org/browse/package/5224.html), in codeigniter project.

also there is another class which i would like to use, simplehtmldom (http://sourceforge.net/projects/simplehtmldom).

could u people guide me how can i use these within codeigniter.

thank u

rakesh jangid
#2

[eluser]NogDog[/eluser]
You could possibly create library classes with them.
#3

[eluser]rakesh[/eluser]
my knoweledge is limited and i couldnt follow userguide for these perticular classes.

could u please explain specifically for above classes. how to put them in library and then how to initialise/use them in a controller.

thanks
#4

[eluser]NogDog[/eluser]
[quote author="rakesh" date="1239346077"]my knoweledge is limited and i couldnt follow userguide for these perticular classes.

could u please explain specifically for above classes. how to put them in library and then how to initialise/use them in a controller.

thanks[/quote]
Since I do not know those specific classes, no, I cannot.

In general, copy the class file to "<CI directory>/application/libraries/classname.php" where "classname" is the name of the class. Make sure that in the actual class file the class is named with an initial capital letter; e.g. the class is named "Myclass" while the file is "myclass.php".

Then in your controller:
Code:
$this->load->library('myclass');
// use a method from it:
$this->myclass->some_method();
Of course, this is just a synopsis of what I linked to in the users' guide, so it might not be any help.




Theme © iAndrew 2016 - Forum software by © MyBB