Controlling the display of 2 groups among another field

georgie

Member
Hi

I have a little difficult PHP demand, which I have already asked by the past, but with an old version of Fabrik.
You had advice me, but ask to update. Now I have updated. But I prefer open this new ticket, and redo my demand, for more clarity for me.

Here: I would display or hide, in a personnal PDF template, 2 groups according the value of a field which is not in these 2 groups... :oops:
I would control the displaying by "does not contain" about the field.

I think I have to modify this kind of code, to add another group in the same code (or another code line for the orther group), and changing the "===" for a "!=", or other:

Code:
if ((int) $group->id === 646 && $this->groups['PR ? s?lectionner (Choix BMP 2)']->elements['commentaires_bmp']->value === 'Projet non-examin?') :continue;endif;

But I have another difficulty: the field in question is a dropdown with multiple selection. For example, it can be equal to:

Code:
["value1","value2","value3"]

So, I think I have to do an "explode" before, or other... But it is not easy !

Can you help me ? Am I in the good direction ?

THX
 
That's JSON, so the easiest way is to decode it ...

Code:
$values = json_decode($the_thing_you_want_to_decode);

... which will give you an array with those values in it.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top