From 3ebb751cda5d47147a5c828b4cb32ecd4a9f8042 Mon Sep 17 00:00:00 2001 From: Jozef Selesi Date: Tue, 18 Nov 2008 08:28:32 +0000 Subject: 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() --- core/config/routes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/config') diff --git a/core/config/routes.php b/core/config/routes.php index 465fb885..567e999e 100644 --- a/core/config/routes.php +++ b/core/config/routes.php @@ -24,7 +24,9 @@ $config['^rest'] = null; $config['^rest/.*'] = null; $config['^(\w+)/(\d+)$'] = '$1/dispatch/$2'; -$config['^form/(\w+)/(.*)$'] = '$1/form/$2'; +// @todo The following will need to support query strings. +$config['^(\w+)$'] = '$1/index'; +$config['^form/(\w+)/(\w+)/(.*)$'] = '$2/form/$3/$1'; // For now our default page is the scaffolding. $config['_default'] = 'welcome'; -- cgit v1.2.3