快捷路由
快捷路由允许你快速给控制器注册路由 并且针对不同的请求类型可以设置方法前缀 例如:
// 给User控制器设置快捷路由
Route::controller('user','index/User');
User控制器定义如下:
<?php
namespace appindexcontroller;
class User
{
public function getInfo()
{
}
public function getPhone()
{
}
public function postInfo()
{
}
public function putInfo()
{
}
public function deleteInfo()
{
}
}
可以通过下面的URL访问
get http://localhost/user/info
get http://localhost/user/phone
post http://localhost/user/info
put http://localhost/user/info
delete http://localhost/user/info
尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题