Welcome Guest, Not a member yet? Register   Sign In
Bays - Easy "widgets" for your views
#8

(10-15-2015, 11:32 AM)Kulavert Wrote: Is it possible to use Bay within CodeIgniter2 environment? What modifications should I make in Bay's source code?
(10-16-2015, 09:51 AM)mwhitney Wrote: Since it's loaded via Composer, you'd first have to get that working with your CI2 environment. In the past, I did this by copying the relevant code from CI3, which is in /system/core/CodeIgniter.php.

I've always gone the lazy way and just add 'include "vendor/autoload.php" at the top of the index.php file. I've never ran into any issues that way. Other than that, it should all work, I believe. You can use the CI3Cache and CI3Finder files and they should work without modifications.

(10-15-2015, 11:48 AM)iamthwee Wrote: Hi Kilishan,

Can you explain why using a helper function to render the shopping cart would be a bad idea. This would make it global (so to speak) and can be accessed within any view. Unless I'm missing something.

That would work fine. My goal with this library (which I put together in an evening, so there wasn't a whole lot of thought put into it, honestly.) was to make a framework-agnostic package. That, and the desire to keep the code clean, made it use multiple methods, so a class was a natural choice. Adding a single method to call, like in a helper, would be a great addition, that would simply call the class' function. Would be easier to work with that way, definitely.
Reply


Messages In This Thread
RE: Bays - Easy "widgets" for your views - by kilishan - 10-16-2015, 08:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB