什么是静态路由? [英] What is Restful Routing?

查看:70
本文介绍了什么是静态路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉Ruby On Rails的路由系统,以及Code Igniter和PhpCake如何路由事物,但是它除了具有基于目录结构发出路由的集中位置之外,还具有更多的功能?像这样

I'm familiar with Ruby On Rails's routing system and well as how Code Igniter and PhpCake route things but is there more to it than having a centralized location where you give out routes based on a directory structure? Like this

controller/action/id/
Admin/editUser/22

推荐答案

基本前提是,它是一种结合,而不是仅依靠URL来指示您要转到的网页(仅使用一种方法) VERB和URL.

The basic premise is, instead of relying exclusively on the URL to indicate what webpage you want to go to (and just using the one method), it's a combination of VERB and URL.

这样,相同的URL与不同的动词(例如GET,PUT,POST,DELETE)一起使用时,将带您进入不同的页面.这样可以使网址更简洁,更短,并且特别适合大多数Web应用程序所使用的CRUD应用程序.

This way, the same URL, when used with a different verb (such as GET, PUT, POST, DELETE), will get you to a different page. This makes for cleaner, shorter URLs, and is particularly adapted to CRUD applications, which most web apps are.

这篇关于什么是静态路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆