symfony의 exeption 및 일부 매개 변수에 문제가 있습니다. 수천 개의 코드를 검사하고 인터넷에서이 예외가 발생하는 이유를 전혀 알지 못합니다.Symfony2.7 : Twig render controller()가 내 매개 변수를 무시합니다.
는 예외입니다 :
예외가 템플릿의 렌더링 ("."슬러그 "일부 필수 매개 변수 (누락" ") 경로의 URL 생성"blogcomment_create을)에있는 동안 발생 된 @Blog \ 기본 라인에서 블로그 \의 singlePost.html.twig \ 29
경로 구성 :
이blogcomment_create:
path: /{slug}/comment/create/
defaults: { _controller: "BlogBundle:Comment:create" }
requirements: { methods: post }
내 나뭇 가지 템플릿 내 코드 가져 오기 내 컨트롤러 :
<footer>
{{ render(controller('BlogBundle:Comment:create', {
'slug': Post.slugname
})) }}
</footer>
내 행동 선언 :이 예외 미친지기 시작
public function createAction(Request $request, $slug = null)
{
//...
}
내가 그녀를 얻고 난 정말 눈의 좋은 쌍을해야하는 이유, 내가 어떤 단서가 없다.
은 내가 exemples의 톤을 시도해보십시오
How to insert a Controller in Twig with "render" in Symfony 2.2?
symfony2 - twig - how to render a twig template from inside a twig template
Change template via parameter when render a controller action?
... 여기
fonction의 덤프
:object(Symfony\Component\HttpKernel\Controller\ControllerReference)[992]
public 'controller' =>
string 'BlogBundle:Comment:create' (length=31)
public 'attributes' =>
array (size=1)
'slug' => string 'article-de-test-yolowowo' (length=24)
public 'query' =>
array (size=0)
empty