Convert this PHP Class to CI Library |
[eluser]Unknown[/eluser]
Hi! I need to use this Class in a CI 2.1 project, and I would like to know how to convert it to work on CI. Code: http://pastebin.com/HKTvWsGK I tried this: I copied the class php file to the application/libraries/ folder, and then wrote this in a controller: Code: $this->load->helper('file'); But I get this Warning message when I run it: Quote:A PHP Error was encountered Then after that error message, the correct output is shown. But don't know how to avoid the error message. Any ideas? Thanks!
[eluser]InsiteFX[/eluser]
Your loading the library but not passing the config into it! Code: $this->load->library('JavaScriptPacker', $config); But it wont work because it has another class in it. You can use the include statement to include it and try that.
[eluser]Bhashkar Yadav[/eluser]
@InsiteFX: yes, there are 2 classes. it can also work by creating 2 custom library files for JavaScriptPacker and ParseMaster as second class isn't extending first one.
[eluser]Unknown[/eluser]
Thanks InsiteFX and Bhashkar In terms of performance, speed, best practices, etc, what would be better to do? Do a normal include and call the functions as the documentation shows, or create separate libraries of both JavaScriptPacker and ParseMaster? Thanks! |
Welcome Guest, Not a member yet? Register Sign In |