Cod .twig in .php
Last Updated: Apr 24 2018 17:44, Started by
xxvirusxx
, Apr 24 2018 13:52
·
0
#1
Posted 24 April 2018 - 13:52
Poate cineva sa-mi explice cum se scrie aces cod twig in php?
{% for index, error_type in error.manufacturer %}{% if index == manufacturer_number %} Mersi Edited by xxvirusxx, 24 April 2018 - 13:59. |
#2
Posted 24 April 2018 - 14:46
foreach ( error.manufacturer as index=>error_type){ if(index == manufacturer_number){ } } cred ca asa |
#3
Posted 24 April 2018 - 14:53
Mersi.
Functional ar fi si asa nu? <?php foreach ($error['manufacturer'] as index=>error_type) { ?> <?php if (index == $manufacturer_number) {?> <?php } ?> <?php } ?> Edited by xxvirusxx, 24 April 2018 - 14:55. |
#4
Posted 24 April 2018 - 15:43
Pai $error e obiect sau array?
Am uitat sa pun $ la variabile P.S. Nu trebuie sa pui tag-ul php la fiecare linie, il deschizi unde incepe codul php si il inchizi unde se termina. <?php foreach ($error['manufacturer'] as $index=>$error_type) { if ($index == $manufacturer_number) { } } ?> |
#5
Posted 24 April 2018 - 15:48
#6
Posted 24 April 2018 - 17:44
Am rescris dupa postul lui @antiqque iar la a 2-a editare s-a bulit.
|
Anunturi
Bun venit pe Forumul Softpedia!
▶ 0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users