First iteration of REST controller refactoring. RESTful controllers that refer to collections should now have plural names and there should be only one controller per resource. Updated existing classes that implement REST_Controller. The routing now works like this:

GET    /controller    -> controller::_index()
POST   /controller    -> controller::_create()
GET    /controller/id -> controller::_show()
PUT    /controller/id -> controller::_update()
DELETE /controller/id -> controller::_delete()
GET    /form/edit/controller/resource_id -> controller::_form()
GET    /form/add/controller/data         -> controller::_form()
This commit is contained in:
Jozef Selesi
2008-11-18 08:28:32 +00:00
parent 59dbd1dc83
commit 3ebb751cda
11 changed files with 192 additions and 192 deletions

View File

@@ -31,7 +31,7 @@ class user {
*/
public static function get_edit_form($user) {
$form = new Forge(
url::site("user/{$user->id}?_method=put"), "", "post", array("id" => "gUserForm"));
url::site("users/{$user->id}?_method=put"), "", "post", array("id" => "gUserForm"));
$group = $form->group(_("User Info"));
$group->input("name") ->label(_("Name")) ->id("gName") ->value($user->name);
$group->input("display_name") ->label(_("Display Name")) ->id("gDisplayName") ->value($user->display_name);