Created
November 19, 2013 06:07
-
-
Save eyedol/7541013 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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