문제

I have this Action to handle the user login also via REST api call:

/**
 * Login Action
 *
 * @param Request $request
 */
public function postLoginAction(Request $request)
{

This is what php app/console router:debug shows me:

en__RG__post_login                          POST     ANY    ANY  /api/1/logins.{_format}

In this case the automatic pluralization to "logins" is not so nice... any ideas how to get only "login"?

도움이 되었습니까?

해결책

You can manage default route pluralization by overriding fos_rest.inflector.doctrine service. refer this issue and followed pull request.

or

for change pluralization of single route it can be done by using Manual definition of routes please refer this documentation from FOSRESTBUNDLE repository

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top