get('/upload/', $this->call('getUploadForm')) ->bind('upload_form'); /** * UPLOAD route * * name : upload * * description : Initiate the upload process * * method : POST * * parameters : 'bas_id' int (mandatory) : The id of the destination collection * 'status' array (optional) : The status to set to new uploaded files * 'attributes' array (optional) : Attributes id's to attach to the uploaded files * 'forceBehavior' int (optional) : Force upload behavior * - 0 Force record * - 1 Force lazaret * * return : JSON Response */ $app->post('/upload/', $this->call('upload')) ->bind('upload'); return $controllers; } /** * Render the html upload form * * @param Application $app A Silex application * @param Request $request The current request * * @return Response */ public function getUploadForm(Application $app, Request $request) { } /** * Upload processus * * @param Application $app The Silex application * @param Request $request The current request * * @return Response */ public function upload(Application $app, Request $request) { } /** * Prefix the method to call with the controller class name * * @param string $method The method to call * @return string */ private function call($method) { return sprintf('%s::%s', __CLASS__, $method); } }