Exemple #1
0
 /**
  * Create new article
  *
  * POST /api/articles
  */
 public function postAction()
 {
     $article = $this->resource->create($this->Request()->getPost());
     $location = $this->apiBaseUrl . 'articles/' . $article->getId();
     $data = array('id' => $article->getId(), 'location' => $location);
     $this->View()->assign(array('success' => true, 'data' => $data));
     $this->Response()->setHeader('Location', $location);
 }