Welcome Guest, Not a member yet? Register   Sign In
Add library with namespaces

There are basically two options to approaching this:

1) Just use it as instructed by the existing documentation.
2) Build a wrapper/adapter to make the library available as if it were a CI library.

#1 is usually the easiest way to handle it, but it sometimes causes issues for some people to switch code styles in the middle of a controller (or wherever you happen to be using it).

#2 usually involves little more than creating a CI library which loads the required files for the non-CI library (or you can use Composer to load the files) and initializes the library as needed in the constructor.

Of course, the more extensive the use of the library, the more likely it is that you will have to write additional code to make the library interact with your code in this manner. In the end, that code is only of significant value if you intend to be able to swap out the underlying library in the future and/or you know that switching coding styles to use this library will be an issue.

Messages In This Thread
Add library with namespaces - by turtuga - 01-05-2015, 05:09 AM
RE: Add library with namespaces - by mwhitney - 01-05-2015, 12:49 PM
RE: Add library with namespaces - by no1youknowz - 01-05-2015, 05:38 PM
RE: Add library with namespaces - by Avenirer - 01-06-2015, 07:07 AM
RE: Add library with namespaces - by XMadMax - 01-21-2015, 07:32 AM

Theme © iAndrew 2016 - Forum software by © MyBB