Object Oriented Programming….
Before the Aaruush 12 project, i had oops only as a concept but this time i implemented it, and yes it saves a lot of work, as well as makes the code to look nice…
So what i did was, i made a core api which worked around all the database operations.
The idea I used:
- Made classes which did operations on a particular table in the database. The functions were created as and when required by either extending them with some more variables ( as php allows a default value for functional parameters it is very easy to extend usage of function).
- These functions can be reused in again, so simplifying the look of main outer code.
- I made a class for html form elemets, so to create a form i just have to call the function and pass the id, name, class, of the element and i get the html. after appending these, i wrap them around a form. and this all happens inside php. so the code looks more decent.