php - How to manage CodeIgniter project code in a big project -
I have some personal doubts about CodeIgniter project management. As a developer I have more than 1 year experience in CodeIgniter. But now I am working on a project (e-commerce) which is working under me completely and I am a single developer
- Confusion about building a library or model!
- When the model / library passes through the variable, the function is sent through the parameter or the class object variable of that model / library setting !!
Such general disclaimer - my suggestion to use libraries to interact with third parties - Creating credit card transactions, shipping etc. Apart from separation, another reason is that there will often be PHP libraries for these services that you want to integrate.
otherwise use the model normal and then start the refactor so the models are very specific. Try using folders to help organize and explicitly exclude responsibilities. The model displaying different performance products vs e-commerce work should be different than the model model that populates the cart. For example:
Model / Store / Product - Display Products and its Variations
Model / cart / item - Current value, inventory, etc. validates
For many reasons, I think its cleaner has to make form validation in a model. If the form fields are available in the model, the controller is simply asking - Enter the validation on this form whether it is valid or not any / every form or post call, even if there is no clear user input.
More suggestions: Do not use the CI cart library. Your administrator administrator (review the product, order, etc.) should be in completely separate application folder. The model / cart / item gets the price directly from the product table - do not pass the price in the Buy button. Keep in mind that people can put things in a car and come back a week later - the price and inventory check should be part of the checkout process.
Unless you get money, this is not a real "order", so even though you do the checkout process - there is a table, which is just the last complete order.
Comments
Post a Comment