Fosrestbundle: ๋ผ์šฐํŒ… ์˜ต์…˜ "์ƒ์œ„"๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2011๋…„ 07์›” 24์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: FriendsOfSymfony/FOSRestBundle

Symfony ๋ผ์šฐํŒ…์€ "์ƒ์œ„" ์†์„ฑ์ด ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ํ†ตํ•ด ์„ค์ •๋˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•˜๊ณ  ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๊ธฐ๋ณธ ๋ผ์šฐํŒ… ๊ตฌ์„ฑ ๋‚ด์—์„œ restful ๊ฒฝ๋กœ๋ฅผ ๋กœ๋“œํ•˜๋ ค๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. parent ๋ฐ ๊ธฐํƒ€ rest ํŠน์ • ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด๋Ÿฌํ•œ ๊ตฌ์„ฑ์„ restful ์ปฌ๋ ‰์…˜์œผ๋กœ ์ด๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ์ž˜๋ชป๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค .

# app/config/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

๊ทธ๋Ÿฌ๋‚˜ ์ด๊ฒƒ์€ ์ •ํ™•ํ•ฉ๋‹ˆ๋‹ค .

# app/config/routing.yml
users:
  type: rest
  resource: path/to/your/bundle/routing.yml
# path/to/your/bundle/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

๋ชจ๋“  3 ๋Œ“๊ธ€

์—ฌ๊ธฐ ์˜ˆ๋ฅผ ๋“ค์–ด ์ฃผ์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?

๊ธฐ๋ณธ ๋ผ์šฐํŒ… ๊ตฌ์„ฑ ๋‚ด์—์„œ restful ๊ฒฝ๋กœ๋ฅผ ๋กœ๋“œํ•˜๋ ค๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. parent ๋ฐ ๊ธฐํƒ€ rest ํŠน์ • ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด๋Ÿฌํ•œ ๊ตฌ์„ฑ์„ restful ์ปฌ๋ ‰์…˜์œผ๋กœ ์ด๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ์ž˜๋ชป๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค .

# app/config/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

๊ทธ๋Ÿฌ๋‚˜ ์ด๊ฒƒ์€ ์ •ํ™•ํ•ฉ๋‹ˆ๋‹ค .

# app/config/routing.yml
users:
  type: rest
  resource: path/to/your/bundle/routing.yml
# path/to/your/bundle/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

๋ผ์šฐํ„ฐ ๊ตฌ์„ฑ์—์„œ ์œ ํ˜•์„ ์ •์˜ํ•˜์—ฌ ๋‚˜๋จธ์ง€ ์œ ํ˜•์˜ ๊ธฐ๋ณธ ํŒŒ์ผ์„ ๋กœ๋“œํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰