I have difficulties to get the structure of the array / object form->getData(). also I wanted to know there is a way to get it easily.
I have tried the following but there are to many information therefore it isn't readable
$data = $form->getData();
$for_twig_data = var_dump($data);
I also tried the following, but $data_value_value is an object, therefore I cannot fetch throught it:
$liste_key = '';
foreach($data as $data_key => $data_value)
{
$liste_key = $liste_key."[".$data_key."]";
if(is_array($data[$data_key]))
{
foreach($data_value as $data_value_key => $data_value_value)
{
$liste_key = $liste_key."(".$data_value_key.")".$data_value_value;
if(is_array($data[$data_key][$data_value_key]))
{
foreach($data_value_value as $data_value_value_key => $data_value_value_value)
{
$liste_key = $liste_key."{".$data_value_value_key."}";
}
}
}
}
}
Aucun commentaire:
Enregistrer un commentaire