I have a PHP app and 90% of the code is about managing multiple MySQL tables. But there are other systems like a User system and an Admin system, etc. All PHP requests are processed in one App file, so this file needs to dispatch requested commands and send along params. The question is, where does the routing end and the params begin? Please understand that I don't have access to the httpd.conf file so I cannot do real routing. This is simulated routing. Take this examplesite.com/app.php?route=table&tableName=tableA&cmd=get&id=20&sort=ascorsite.com/app.php?route=user&cmd=login&user=bob&pw=bobbySo the first route is easyfunction route($route){   switch($route){      case table:         $this->tableRoute();         break;      case user:         $this->userRoute();         break;   }}function userRoute(){    // its easy to stop routing here    switch($_REQUEST['cmd']){        case login:            break;        case register:            break;    }   }function tableRoute(){   // but here tables need a subroute    // so is this where routing ends, or does routing continue?   switch($_REQUEST['tableName']){       case tableA:          break;   }}My design dilemma is when am I done routing and when do I start processing commands? For example, if there are 20 tables the tableRoute is technically still routing to the next table and the command is not processed yet. So should the route query actually besite.com/app.php?route=tables/tableName&cmd=get&id=9.....where the route is properly escaped? Or does the route end at the first route. I've also seen people use the second portion of the route, after the slash, as a command, so maybe it is supposed to besite.com/app.php?route=tables/tableName/get&id=9...
PHP Where do routes end and queries begin
php