Welcome Guest, Not a member yet? Register   Sign In
The session class has a push method but no pop method
#8

(03-06-2019, 11:20 AM)ciadmin Wrote: 1) Session::push is not part of SessionInterface, and I don't know that it should be relied on

2) Session::push as implemented is intended to merge additional array values into an existing session variable which has an array value. This does not sound like a conventional "push/pop" kind of thing, and I think the method is mis-named. A better name for the method might be "updateValues".

This does not look like a stack data structure, where push/pop make sense.

Hi,

actually, I have chosen the name pop because it often as the opposite from push. I only prefer to have an undo function if there is a do function, especially if you cannot directly access the underlying array via the CI interface.
Reply


Messages In This Thread
RE: The session class has a push method but no pop method - by HardyW - 03-06-2019, 12:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB