What are these routing styles called in a web application?

本秂侑毒 提交于 2019-12-11 10:35:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!