DB conditions

rtobias 24 Apr, 2017
I'm sorry if this was asked already (looked and didn't see), but I just wanted to confirm:

In CF6, we can now write conditions (order fields, return fields, etc.) as either:
<?php return array("email"=>$form->data['email'], "id"=>$form->data['id']);?>


or (multiline list):
email
id

If this is indeed the case, awesome; being able to use either a multi-line list or a php array everywhere will be quite a bit easier.
Max_admin 24 Apr, 2017
Hi Randy,

Yes, this is correct, but the PHP format is a bit different:

<?php
return [["email", $this->data("email")], ["id", $this->data("id")]];


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
rtobias 24 Apr, 2017
Thanks Max!

This is related: I didn't see a Handle Array action, but I did see a Modify Data action. I wasn't sure if that is what should be somehow used instead, or if the new DB actions didn't need special handling anymore. I know you've updated them a whole lot (I'm very impressed).
Max_admin 24 Apr, 2017
Answer
Hi Randy,

With the latest update you can convert any array values easily, lets say you have a checkboxes group called "checkboxes", by default you use {data:checkboxes}, but for array values you can get a comma separated list:

{data/join:checkboxes}

or json string:

{data/jsonen:checkboxes}

In the "Data override" box of the "Save data", you can add or modify fields values, so you could use the following to store a json string of the array values:

checkboxes:{data/jsonen:checkboxes}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.