问题
What do you call routing that maps one URL directly to a file?
Example:
http://localhost/directory/file.php
=> /var/www/apache/htdocs/directory/file.php
What do you call routing like one on https://github.com/nikic/FastRoute?
Example:
http://localhost/directory/file
=> request actually goes to a single index.php
file, which then loads routing files or tables and loads appropriate class as defined in the routing table.
回答1:
What do you call routing that maps one URL directly to a file?
I would call that no routing. Or maybe direct routing? I've never heard anybody use a term specifically for it.
What do you call routing like one on https://github.com/nikic/FastRoute?
That's (typically) the front controller pattern.
来源:https://stackoverflow.com/questions/48079853/what-are-these-routing-styles-called-in-a-web-application