Modern workflow / project architecture with PHP
- by Sprottenwels
I wonder how one professional developer would design the backend-part of his application.
I try to use PHP as seldom as possible and only for data serving/saving purposes.
To do so, i would create a module/class for every greater part of my application, then write some single script files which are called by javascript.
E.g:
User clicks a "retrieve data" button
javascript will call retrieveData.php
retrieveData.php will create an instance of the needed class, then executes myInstance-retrieve()
the data is returned to my JS by retrieveData.php
However, i see some disadvantages in this practice:
I will need a single scipt file for every action, (e.g retrieveData.php, saveData.php etc)
I need a man-in-the-middle step: from JS to my single script, to my classes
How are modern applications designed to accomplish what i need to do?