diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2008-11-11 06:18:45 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-11 06:18:45 +0000 |
| commit | dae36c2aa4afebb38cc3235b46c6490b2f771aa1 (patch) | |
| tree | 1bed990004815ce28d4104cf7fb39356fcaeaa08 /core/config/routes.php | |
| parent | 62bb63a70d35feb4517afa29f83cf2f5d7fd4be9 (diff) | |
Create REST_Controller abstract base class for all REST based resource
controllers. Any controller that wants to act RESTful can extend this
class and implement get/post/put/delete.
Tweak default routes to disallow direct access to the REST controller
and direct access to any REST methods.
Diffstat (limited to 'core/config/routes.php')
| -rw-r--r-- | core/config/routes.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/config/routes.php b/core/config/routes.php index 5c34acb7..9b958df1 100644 --- a/core/config/routes.php +++ b/core/config/routes.php @@ -17,5 +17,15 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +// REST configuration +// Any resource requests (eg: album/1 or comment/3) get dispatched to the REST +// dispatcher. Any direct calls to REST methods are also forced into the dispatcher +// since the REST methods are internally expecting an ORM, not an id. +$config['^rest'] = null; +$config['^rest/.*'] = null; $config['^(\w+)/(\d+)$'] = '$1/dispatch/$2'; +$config['^(\w+)/(?:get|post|put|delete)/(\d+)$'] = '$1/dispatch/$2'; + +// For now our default page is the scaffolding. $config['_default'] = 'welcome'; |
