Welcome Guest, Not a member yet? Register   Sign In
how can i preset a variable value and get access to it in CI
#6

[eluser]obiron2[/eluser]
I'd be tempted to create a model as they are 'properties' of the user.

Create a method in the model to return the array and call if from the controller.

Later on, when your project gets more complex, you can update the model to retrieve the properties from a database and the whole thing will still work.

that is the beauty of MVC; the controller doesn't care how the model prepares the data, as long as it gets back the expected result.

I use this technique a lot for menu functions - while the list is fixed/limited and in development I return a hard coded array. when the site goes live and menus need to be derived from user profiles then the array is built dynamically in the model.

Obiron


Messages In This Thread
how can i preset a variable value and get access to it in CI - by El Forum - 08-04-2009, 07:38 AM



Theme © iAndrew 2016 - Forum software by © MyBB