symfony - Symfony2 FOSRestBundle: Which class to include for codes like HTTP_NO_CONTENT -
i wanna throw http_no_content, symfony tells me classnotfoundexception: attempted load class "codes" namespace "fos\rest\util". need "use" namespace?
i did use fos\restbundle\util\codes;
in class.
my call looks
public function deleteaction($id) { $em = $this->getdoctrine()->getmanager(); $player = $em->getrepository('xxx')->find($id); $em->remove($player); $em->flush(); return $this->view(null, new http_no_content); }
why not possible find class?
new http_no_content
doesn't make sens here! you've use fos\restbundle\util\codes
class,
use fos\restbundle\util\codes;
and point right status code follow,
codes::http_no_content // http_no_content defined constant
Comments
Post a Comment