What is the disadvantage in not using a route file in php?

1

In several frameworks it is necessary to set a route in the system, as in the example below.

Route::get('MeuController/MinhaAction', function ($name) { // })

However, I would like to know what happens by working as follows without having a path file defined.

In case, when accessing the site, my code would check if the MeuController file exists. If it exists, it instantiates the class MyController . Once it is instantiated, it checks if there is a MinhaAction action, if this is true it would display the content of that particular controller, if it does not exist, it would report an error page.

Finally, in practice this works normally and is widely used, but frameworks do not work that way. Does it affect anything? In which situations could I experience problems on my system?

    
asked by anonymous 13.06.2016 / 03:50

0 answers