Created
March 20, 2012 10:17
-
-
Save ghengeveld/2133851 to your computer and use it in GitHub Desktop.
CotORM/REST example controller
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
<?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