Welcome Guest, Not a member yet? Register   Sign In
Feature Suggestions? (Variables in Model's)
#1

[eluser]beneck[/eluser]
I tried to search, but I couldn't find a similar thread.

Is there a "feature suggestion" for CI? I know that EL is looking for someone to take it over, but they say that it's status quo in the mean time.

The reason I ask is because I would like to suggest that the model load functionality be able to take a 3rd parameter..an array.. for the construct model.

Here is an example of what I would like to see CI do in the future.....

Code:
$construct_vars = array("username", "password");

$this->load->model('user_model', 'user', $construct_vars);

The idea would be that the array is broken out and the item at index 0 becomes the first argument in the __construct() function, and the item and index 1 becomes the second argument (and so on and so forth) so that you can build more powerful model.

As of right now, the only two options I see are to

1) Look and see if any constructor arguments were passed, if not, then create an empty object. Then after I load the model, I simply create a new instance of it with the constructors I need.

OR

2) make a special construct function so that after the model is loaded, I call my own constructor such as $this->user->_construct('username', 'password');.

Either way seems like an extra step


Messages In This Thread
Feature Suggestions? (Variables in Model's) - by El Forum - 08-09-2013, 11:00 AM
Feature Suggestions? (Variables in Model's) - by El Forum - 08-09-2013, 11:01 AM
Feature Suggestions? (Variables in Model's) - by El Forum - 08-09-2013, 01:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB