Skip to content

Instantly share code, notes, and snippets.

@ghengeveld
Created March 20, 2012 10:17
Show Gist options
  • Save ghengeveld/2133851 to your computer and use it in GitHub Desktop.
Save ghengeveld/2133851 to your computer and use it in GitHub Desktop.
CotORM/REST example controller
<?php
defined('COT_CODE') or die('Wrong URL.');
class ProjectController extends RESTController
{
public function create()
{
$this->respondsTo('POST');
$data = Project::import();
$obj = new Project($data);
if ($obj->insert())
{
// succesfully added to database
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment