Where to put the business logic |
[eluser]Unknown[/eluser]
Hi. I'm a new user with CodeIgniter and I have a doubt about where I need to put my files. I think I understand perfectly what is the purpose of the controlers, models and views but in my application I have some "business logic" At the moment, I am putting in the "third_party" folder and I am loading it in the "autoload" file using the "require_once" PHP statement. But I think that CodeIgniter must provide a more logical solution to this, isn't it? Again, sorry about my poor English y thanks very much por your patient and effort.
[eluser]daniel ispas[/eluser]
Hi, You can use the loader class like this: Code: $this->load->add_package_path() Hope this helps
[eluser]JamieBarton[/eluser]
What is the business logic you're referring to? Do you have any examples? Normally I would put any business logic that isn't going to be re-used in the Controller, sometimes I'll put it in the Model, it really just depends on the App, and the scale of it for my use. Show us what you're putting in the third party folder and classing as 'business logic'. Have a look at Helpers too which you can use for stuff you want to access in your Controllers & Views. Thanks |
Welcome Guest, Not a member yet? Register Sign In |