Welcome Guest, Not a member yet? Register   Sign In
A little help with a function to display a message popup.
#11

[eluser]Samuurai[/eluser]
[quote author="jedd" date="1253570006"]
The reason you might not use flash (as I mentioned way back when) was because you need to refresh it on every pass-through a redirect page. This can be tiresome.
[/quote]

Sometimes it takes a while to realise what you mean. Got it now.

I don't think it's bodgy to use the flashdata. So far I haven't had a requirement to refresh the data for the next pass-through, but I might soon and will probably be eating my words at that time.

Thanks for re-iterating the point.

me understand now!!
#12

[eluser]jedd[/eluser]
Fairy nuff.

It was because of this bit that I concluded you had some understanding of the features and limitations of flash data, and a belief that you were using (many) redirects.

[quote author="Samuurai" date="1253546318"]
I am using redirects so I'm going to use the flashdata in some cases, but I want to also use normal $data->message = "blah" then load the view, passing $data.
[/quote]

I refresh some of my flashdata, during redirects, but I've been considering going through and changing those - it seems neater to a) just ensure that I catch the real session data properly in the first place, and b) not have to work out where and when I need to do a keep_flashdata.

I reason that if I do miss using the data somewhere, it'll be over-written later in any case - as I'll be consistently using the same variable name for this feature - so it's not like the cruft will build up over time.
#13

[eluser]Samuurai[/eluser]
Makes a lot of sense when you put it like that.

I said redirects (plural) because I put them in a lot of my functions in my controllers.

This is my first ever site build and I'm just getting my head around it. I first coded my site so that the destination page did the work. For instance, if a user clicks the logout button, it loads the home page, the homepage checks for the existence of post('submit') and then logs them out.

I soon realised this was getting very messy and started using redirects.

It's been a fun learning experience so far. I looked at some other frameworks like CakePHP and I did a bit on Rails, but I love the balance of features and freedom that you get with CI.

Plus the people on this forum ever helpful too.

Cheers,

B




Theme © iAndrew 2016 - Forum software by © MyBB