i am using symfony 2.2.3
with FOSRestBundle
to implement Restful
webservices.
here is my code but when i fire following url i am getting following error
No route found for "GET /business/john"
here is the controller code
use FOS\RestBundle\Controller\Annotations as Rest;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Routing\ClassResourceInterface;
class BusinessController extends Controller {
public function getBusinessAction($para){
return new JsonResponse(array('name' => $para));
}
}
here is my url
http://localhost/symfony/web/app_dev.php/business/john
here is my route
if i remove the argument from url and from function getBusinessAction
then it works but not with arguments/
_business:
resource: "@HubHomeBundle/Controller/BusinessController.php"
type: rest
update
inside app/confing/routing.yml
hub_home:
resource: "@HubHomeBundle/Resources/config/routing.yml"