how to use the class.upload.php as a library? |
[eluser]Jônatan fróes[/eluser]
i'm new in CI so i'd like to use the class.upload ( see the class page here ) does someone could help me? sorry for my 'brazilian' english...
[eluser]gunter[/eluser]
you can include the class with include().... if you want... or you can make a library out of it, but thats a little bit more difficult, because in a CI library you cannot use constructor parameters....
[eluser]wiredesignz[/eluser]
You can use library constructor parameters Code: $this->load->library('some_library', $params);
[eluser]benofsky[/eluser]
[quote author="wiredesignz" date="1209744058"]You can use library constructor parameters Code: $this->load->library('some_library', $params); If you still want to use your class, put it on /system/application/libraries and you can load it like above.
[eluser]Jônatan fróes[/eluser]
thnaks... I"ll try and come back to say what happened
[eluser]gunter[/eluser]
uh, thanks for the lesson, gentlemen!! I didn´t know that its possible to pass parameters ;-P
[eluser]Patrikk[/eluser]
Hi everyone, my first post here and I would also like to use the class.upload instead of the built in one. Ive been reading this thread but need some more help to pull this off. Ive done the following: * added the class.upload in libraries folder. * made a controller called upload and a view called upload also. * loaded the class.upoload in the controller like it was suggested here ( $this->load->library('class.upload'); ) My problem is: I get the following error message: Fatal error: Cannot redeclare class upload in ...\system\application\libraries\class.upload.php on line 550 what am I missing as very new with CI so I need help from the experts on this forum. thx all help that I get
[eluser]Jônatan fróes[/eluser]
1. Copy the folder class.upload to libraries directory; 2. Create a new library with this code: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 3. Now, in your controller, use this: Code: $this->load->library('imaging');
|
Welcome Guest, Not a member yet? Register Sign In |