Skip to content

Instantly share code, notes, and snippets.

@kiall
Created August 24, 2011 16:49
Show Gist options
  • Save kiall/1168513 to your computer and use it in GitHub Desktop.
Save kiall/1168513 to your computer and use it in GitHub Desktop.
Nasty -_-
<?php
$this->_response_links += array(
'create' => $this->_generate_link('POST', Route::url('api', array(
'controller' => $this->request->controller(),
'id' => NULL,
))),
'read' => $this->_generate_link('GET', Route::url('api', array(
'controller' => $this->request->controller(),
'id' => $this->request->param('id'),
)), array(
':id' => 'id',
)),
'update' => $this->_generate_link('PUT', Route::url('api', array(
'controller' => $this->request->controller(),
'id' => $this->request->param('id'),
)), array(
':id' => 'id',
)),
'delete' => $this->_generate_link('DELETE', Route::url('api', array(
'controller' => $this->request->controller(),
'id' => $this->request->param('id'),
)), array(
':id' => 'id',
)),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment