댓글 검색 목록

[php] 간단하고 확장 가능한 PHP 용 REST API 프레임 워크

페이지 정보

작성자 운영자 작성일 21-01-29 09:22 조회 895 댓글 0

Aphiria는 코드베이스에 빠져들지 않고도 표현적인 REST API를 작성하는 데 도움이 되는 분리 된 라이브러리 모음입니다.


https://www.aphiria.com/


final class UserController extends Controller
{
    public function __construct(private IUserService $users) {}

    #[Post('/users')]
    public function createUser(Credentials $creds): IResponse
    {
        $user = $this->users->createUser($creds->email, $creds->password);

        return $this->created("/users/{$user->id}", $user);
    }

    #[Get('/users/:id')]
    public function getUser(int $id): User
    {
        return $this->users->getUserById($id);
    }
}


댓글목록 0

등록된 댓글이 없습니다.

웹학교 로고

온라인 코딩학교

코리아뉴스 2001 - , All right reserved.