-2
내 컨트롤러에서이 코드는로드 내 첫 페이지 : 링크를 누르면심포니는 : 다른 페이지로 나뭇 가지에서 링크
이<a href="{{ path('options') }}">My options</a>
, 내가 원하는에 : 나는 my base.html.twig
에 링크가
/**
* @Route("/main")
*/
public function indexAction()
{
$templating = $this->container->get('templating');
$html = $templating->render('base.html.twig');
return new Response($html);
}
내 @Route("/options")
을 사용하고 내 옵션 페이지로 이동하십시오. 질문은 올바르게 수행하는 방법입니까? 고마워요.
/**
* @Route("/options")
*/
public function showAction(){
return new Response("This will be options page:");
}
는 경로 이름을 추가
지금 경로의 이름을 사용 SensioFrameworkExtraBundle/annotations/routing.html # route-name 또는 경로 기능에서 기본값 사용 – Cerad