我正在使用Symfony2的OAuth包對我的web服務上的用戶進行身份驗證。一切工作正常,但現在我有興趣擴展包含令牌的JSon的字段。爲此,我想創建自己的TokenController,它擴展了OAuth Bundle的TokenController。但每次我得到這個錯誤:無法擴展OAuthServerBundle控制器
Catchable Fatal Error: Argument 1 passed to DAL\WebServiceBundle\Controller\TokenController::__construct() must be an instance of OAuth2\OAuth2, none given, called in C:\xampp\htdocs\DALService\app\cache\dev\classes.php on line 2396 and defined in C:\xampp\htdocs\DALService\src\DAL\WebServiceBundle\Controller\TokenController.php line 22
這是我的TokenController代碼:
<?php
namespace DAL\WebServiceBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use OAuth2\OAuth2;
use OAuth2\OAuth2ServerException;
use FOS\OAuthServerBundle\Controller\TokenController as BaseTokenController;
class TokenController extends BaseTokenController
{
public function tokenAction (Request $request)
{
$response = parent::tokenAction($request);
return $response;
}
}
是怎麼回事的任何想法?
謝謝!
你解決了這個問題嗎? – 2014-11-28 13:01:29