* Changed REST API. Now there are two separate methods for forms:

GET /form/edit/{controller}/{resource_id} -> controller::_form_edit($resource)
  GET /form/add/{controller}/{parameters}   -> controller::_form_add($parameters)
* Updated comment, user and core modules to reflect the API changes
* Cleaned up routing and handling of requests to /{controller}
This commit is contained in:
Jozef Selesi
2008-11-18 23:40:47 +00:00
parent 4bf486955c
commit 1992343c2e
5 changed files with 66 additions and 46 deletions

View File

@@ -71,12 +71,15 @@ class Users_Controller extends REST_Controller {
* Present a form for editing a user
* @see Rest_Controller::form($resource)
*/
public function _form($user, $form_type) {
if ($form_type == "edit") {
$form = user::get_edit_form($user);
print $form;
} else {
return Kohana::show_404();
}
public function _form_edit($user) {
print user::get_edit_form($user);
}
/**
* Present a form for adding a user
* @see Rest_Controller::form($resource)
*/
public function _form_add($parameters) {
throw new Exception("@todo User_Controller::_form_add NOT IMPLEMENTED");
}
}