Welcome Guest, Not a member yet? Register   Sign In
controller variable visible in model, bug or feature?
#21

[eluser]Unknown[/eluser]
[quote author="Jamie Rumbelow" date="1276870258"]Okay, so, you're disappointed that the framework isn't built to exactly how you want it to be? You're disappointed that you don't have your own way? There are plenty of ways of sharing data across the application if needed, you just have to stop being so narrow minded and realise that CodeIgniter works in its own way. If you don't like that way, then just leave and get out of the forums. There are plenty of frameworks out there. Don't complain, don't bash the framework and the way it's designed.

If you don't like it, leave.[/quote]


According to the following statement you said there are plenty of ways to share data across the application, could you give me some pointers on this?

Since having the same variables name on a controller and a model has been giving me some trouble,

thanks in advance!
#22

[eluser]Unknown[/eluser]
Refreshing this old thread, I'd like to say that IMO this "pattern" is very strange and harmul, and leads to unexpected errors and results, being very difficult to debug. For example, having controller with some public fields if you create new model object and you try to insert it, you will have an SQL exception (inserting not existing fields into table). It is very confusing - where are these fields from?

[quote author="mondras" date="1278529214"]According to the following statement you said there are plenty of ways to share data across the application, could you give me some pointers on this?[/quote]

The best way of doing it, used in many enterprise-class applications is to provide singleton object, having access to whole context, and enabling using of context objects. And, in fact, such singletion exists in code igniter, so why not to promote this way of accessing objects in application?

For Jamie Rumbelow, please don't read my post if you don't like it. There are plenty of other posts here.




Theme © iAndrew 2016 - Forum software by © MyBB