Welcome Guest, Not a member yet? Register   Sign In
Create my own cart class named cart

I'd like to override the CI cart class, with my own Cart class, named cart. I need different functionality and for it to use a database instead of sessions.

I could call it MyCart or something, but I'd rather just have it 'Cart'. Any suggstions or reasons why I should just call it something else?

Just go with the standard overwriting of CI classes. When you define a class using your prefix (usually MY_), it allows you to call it by saying $CI->cart->(etc.), effectively replacing CI's cart class.

Not sure why you'd care what the text file and class are titled when you can call it this way, unless it's some sort of severe OCD, in which case, seek help elsewhere.

Thanks.. I think your more right about the OCD part, I've just named it My_Cart

Haha, maybe so.

A certain amount of OCD is good. Just make sure you apply it right, like conforming to standards that make maintaining code easier.

Theme © iAndrew 2016 - Forum software by © MyBB