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
๋ผ์ฐํฐ ๊ตฌ์ฑ์์ ์ ํ์ ์ ์ํ์ฌ ๋๋จธ์ง ์ ํ์ ๊ธฐ๋ณธ ํ์ผ์ ๋ก๋ํ ์๋ ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ธฐ๋ณธ ๋ผ์ฐํ ๊ตฌ์ฑ ๋ด์์
restful
๊ฒฝ๋ก๋ฅผ ๋ก๋ํ๋ ค๋ ๊ฒ ๊ฐ์ต๋๋ค.parent
๋ฐ ๊ธฐํrest
ํน์ ๋งค๊ฐ๋ณ์๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ์ด๋ฌํ ๊ตฌ์ฑ์restful
์ปฌ๋ ์ ์ผ๋ก ์ด๋ํด์ผ ํฉ๋๋ค.์ด๊ฒ์ ์๋ชป๋ ๊ฒ์ ๋๋ค .
๊ทธ๋ฌ๋ ์ด๊ฒ์ ์ ํํฉ๋๋ค .