• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Global parameters

Hi there,

I am trying to create some kind of global parameters. The code flows between 3 controllers before it calls the model, where I want to use the parameters.

I tried using the config class, but when you set the config, it only seems to last while the class is active, it does not change the config value indefinitely.

Is there any other way?

Your help would be much appreciated.

[eluser]Rick Jolly[/eluser]
I'm not sure that I understand your question.

By "global parameters", do you mean global variables? A parameter is a function argument.

By "the code flows between 3 controllers", do you mean there are 3 browser requests, or do you mean you're using an altered CI that is able to call a controller method from another controller.

If I had to guess, I'd say you are trying to store some user data between 3 page requests. In that case, use the session. You wouldn't want to use the config or any other global persistent storage for user data, since all users would use the same storage and overwrite each other's data.

What about using either flashdata or sessions?

did you try putting them in config/config.php ?

[quote author="jrlooney" date="1223580674"]did you try putting them in config/config.php ?[/quote]

Yes, the config files does only last for the life of the class.

I will try sessions ...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.