Skip to content

Instantly share code, notes, and snippets.

@eyedol
Created November 19, 2013 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyedol/7541013 to your computer and use it in GitHub Desktop.
Save eyedol/7541013 to your computer and use it in GitHub Desktop.
/**
* Retrieve a post
*
* GET /api/sets/:set_id/posts/:id
*
* @return void
*/
public function action_get_index()
{
// Respond with set
if ($this->set !== NULL)
{
// Perhaps there is a better way to get to the api/posts/:id controller?
$uri = Route::get('api')->uri(array(
'id' => $this->set->posts->find()->id,
'controller' => 'posts'
));
// Send a sub request to api/posts/:id
$this->_response_payload = Request::factory($uri)->execute();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment