Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Twig]nie widzi zmiennej
szczrzcz
post
Post #1





Grupa: Zarejestrowani
Postów: 153
Pomógł: 0
Dołączył: 20.04.2017
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


W trakcie debugowania chwilę przed renderowaniem:
$twig->render('foo.twig', $array);

$array wygląda tak:

  1. (
  2. [errorMess] => errrror
  3. [errorMsg] => Błąd w wierszu nr: 4.
  4. )


a twig tak:

  1.  
  2. {% if errorMsg is defined %}
  3. {{ errorMsg }}
  4. {% else %}
  5. errorMsg undefined ||
  6. {% endif %}
  7. {% if errorMess is defined %}
  8. {{ errorMess }} ||
  9. {% endif %}
  10. pomidor


a strona wygląda tak:

errorMsg undefined || errrror || pomidory





errorMsg niezdefiniowane. Dlaczego?

Ten post edytował szczrzcz 14.07.2017, 10:29:43
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Pyton_000
post
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Wpadkuj
Kod
    
{{ dump() }}

i zobacz co masz
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 02:18