我使用FOSRest Bundle
与FOSUser
一起使用API创建注册表单。
当我调试FOSRestController.php
时,收到此消息:
致命错误:类 找不到'Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller' d:\ e-electricity.com \厂商\ friendsofsymfony \其余束\ FOS \ RestBundle \控制器\ FOSRestController.php 第24行
我尝试使用composer update来删除缓存,但我仍然收到相同的消息。
abstract class FOSRestController extends Controller
{
/**
* Creates a view.
*
* Convenience method to allow for a fluent interface.
*
* @param mixed $data
* @param int $statusCode
* @param array $headers
*
* @return View
*/
protected function view($data = null, $statusCode = null, array $headers = array())
{
return View::create($data, $statusCode, $headers);
}
/**
* Creates a Redirect view.
*
* Convenience method to allow for a fluent interface.
*
* @param string $url
* @param int $statusCode
* @param array $headers
*
* @return View
*/
protected function redirectView($url, $statusCode = Codes::HTTP_FOUND, array $headers = array())
{
return View::createRedirect($url, $statusCode, $headers);
}
/**
* Creates a Route Redirect View.
*
* Convenience method to allow for a fluent interface.
*
* @param string $route
* @param mixed $parameters
* @param int $statusCode
* @param array $headers
*
* @return View
*/
protected function routeRedirectView($route, array $parameters = array(), $statusCode = Codes::HTTP_CREATED, array $headers = array())
{
return View::createRouteRedirect($route, $parameters, $statusCode, $headers);
}
/**
* Converts view into a response object.
*
* Not necessary to use, if you are using the "ViewResponseListener", which
* does this conversion automatically in kernel event "onKernelView".
*
* @param View $view
*
* @return Response
*/
protected function handleView(View $view)
{
return $this->get('fos_rest.view_handler')->handle($view);
}
}