Example #1
0
 public function post($resource = false, $value = false, $action = 'index')
 {
     $mapper = ucwords($resource);
     if (class_exists($mapper)) {
         $obj = new $mapper();
     }
     if ($value == 'new') {
         $action = 'create';
     }
     if (method_exists($obj, $action)) {
         json_emit($obj->{$action}($value));
     }
 }
Example #2
0
 function create()
 {
     json_emit(array('ok' => true, 'foo' => 'yep'));
 }