ルートに「/」パターンを作成しました。
acme_store_index:
pattern: /
defaults: { _controller: AcmeStoreBundle:Default:index}
次のアクションで:
public function indexAction()
{
$message = $this->getDoctrine()
->getRepository('AcmeStoreBundle:Message')
->findAll();
return $this->render(
'AcmeStoreBundle:Default:index.html.twig',
array('message' => $message)
);
}
また、ローカルホストのインデックスページとしてファイルapp_dev.phpを宣言するvhostをApacheに設定しました。(このようにして、ajax呼び出しなどを行うときに常にURLに含める必要はありません)
/ルートが無視されるのはなぜですか?