「Php/Symfony/Symfony2/routing」の版間の差分

提供: 初心者エンジニアの簡易メモ
ナビゲーションに移動 検索に移動
ページの作成:「==メインrouting.ymlファイルの場所== *app/config/routing.yml ==Bundleごとのrouting.ymlファイルの場所== *src/Acme/HelloBundle/Resources/config/routing....」
 
編集の要約なし
11行目: 11行目:


src/Acme/HelloBundle/Controller/DefaultController.phpのindexAction()にアクセスする
src/Acme/HelloBundle/Controller/DefaultController.phpのindexAction()にアクセスする
==outingのフォーマット(パラメータなし)==
acme_other_homepage:
    path:    /other
    defaults: { _controller: AcmeHelloBundle:Other:index }

2017年1月13日 (金) 09:28時点における版

メインrouting.ymlファイルの場所

  • app/config/routing.yml

Bundleごとのrouting.ymlファイルの場所

  • src/Acme/HelloBundle/Resources/config/routing.yml

routingのフォーマット

acme_hello_homepage:
   path:     /hello/{name}
   defaults: { _controller: AcmeHelloBundle:Default:index }

src/Acme/HelloBundle/Controller/DefaultController.phpのindexAction()にアクセスする

outingのフォーマット(パラメータなし)

acme_other_homepage:
   path:     /other
   defaults: { _controller: AcmeHelloBundle:Other:index }