using different php script with codeignter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: using different php script with codeignter (/showthread.php?tid=37440) |
using different php script with codeignter - El Forum - 01-10-2011 [eluser]immi[/eluser] Hi all! I am new to codeignter and i want to know that if we want to use a script like getid3 Site Link which will be based on many classes and thats script will use include functions for all type of classes can i use it as plugin? or as lib? Kindly reply! Thank You! using different php script with codeignter - El Forum - 01-10-2011 [eluser]ranjudsokomora[/eluser] immi, You should be able to convert those classes to a CodeIgniter plugin. You can read about that here Plugins: CodeIgniter User Guide The biggest thing to be careful of is collision of class names. You shouldn't have a problem with the applications you mentioned but just keep an eye out. using different php script with codeignter - El Forum - 01-10-2011 [eluser]immi[/eluser] Hi Ranj! What i see here is plugin only needs to be ended with _pi.php so all the other depending classes should be ended with _pi.php (which will be on used in main class)? using different php script with codeignter - El Forum - 01-11-2011 [eluser]ranjudsokomora[/eluser] Hello immi, I would suggest following a non CodeIgniter standard for the getID3 plugin. I would create a folder under ./system/plugins called "getID3" (without the quotes) Extract the downloaded getID3 archive to this new folder. Then in ./system/plugins create a getid3_pi.php file Place this in it: Code: <?PHP Then in your controller you would place this code Code: $this->load->plugin('getID3'); You should now be able to use all of the getID3 class(es) inside of your controller by calling their function. Ex. Code: $mp3info = GetAllMP3info(<filename>); using different php script with codeignter - El Forum - 01-11-2011 [eluser]Daniel Moore[/eluser] I'd recommend doing this as either a helper or library, as plug-ins are removed in CodeIgniter 2.0. using different php script with codeignter - El Forum - 01-11-2011 [eluser]ranjudsokomora[/eluser] Daniel Moore, I wouldn't suggest converting getID3 to a helper, as you would have to rebuilt all the include links in each file, but in CodeIgniter 2.0 you could built getID3 as a package, or convert it to a library. |