This is a discussion on how to make good use of includes within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Because my functions tend to become rather lengthy I split up the functions for each subject or action in a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Because my functions tend to become rather lengthy I split up the
functions for each subject or action in a function (a) that checks user input (filter and validation) and if this checks out ok it passes the variables to another function (b) that retrieves or stores the data from/in the database, function (a) then communicates the result (true, false, error, list with data) to the client. Currently I organized all functions per subject (all functions that handle for example 'groups': get, add, modify, delete in a file) and I include all the files when the webservice is called, this is over 500 kB. A different approach would be to only include the functions needed, this means a file for each function, so a lot more includes. What is a good approach ? Pugi! |