제 레이아웃 (나뭇 가지)에 Middleware authentication에서 값을 검색하고 싶습니다. 그것은 좋은 방법입니다,Zend expressive - 레이아웃
'twig' => [
'globals' => [
// Variables to pass to all twig templates
'auth' => (new \Zend\Authentication\AuthenticationService())->hasIdentity(),
],
],
그리고 레이아웃
{% if auth %}
Connect
{% else %}
Not connect
{% endif %}
이 코드는 작동 default.html.twig :하지만,
은 내가 templates.global.pĥp에 넣으면?
감사합니다.
테스트 해 보겠습니다. 고맙습니다 ! – Flo