Chronoconnectivit v6 PHP code for Read Data content

How to access ChronoConnectivity v6 data fields in PHP code.

Overview

The issue occurs when trying to use the placeholder syntax from the CF view content box directly within PHP, which is not valid.
Instead of using the placeholder format, use the get method with the field path as a string to retrieve the data value in your PHP script.

Answered
Connectivity v6
pa paddy285 24 Jan, 2024
Hi,

Another quick question:

I can see that in CCv6 when creating a View - there is an option to create a Table or Repeater view.

In the content box you can enter the code to display the data for a specific field for each row of data.

The format for this is:

{var:repeatername.row.model.field}


and it works perfectly.

Does anyone know what the format of displaying this data would be if entered in PHP?

In CCv5 you could easily enter $row['model']['field']

Thanks in advance, Paddy
pa paddy285 31 Jan, 2024
I just thought I would bump this hoping that Max could let me know if this is possible?

Thanks, Paddy.
pa paddy285 31 Jan, 2024
1 Likes
Hi All,

I just wanted to provide an update as I have finally figured this out. It was pretty straight forward in the end. Within your PHP script, just type the following in:

echo "{var:repeatername.row.model.field}";



And it works perfectly!

Thanks, Paddy
pa paddy285 01 Feb, 2024
Hi again,

I wanted to re-open this and hope that Max can provide a definitive answer for me, because my update didn't resolve my problem.

As stated previously, I'm trying to utilise each row/field of data within PHP.

e.g.: $thisnewvariable = {var:repeatername.row.model.field}; - this didn't work.

I've tried my solution ( $thisnewvariable = echo "{var:repeatername.row.model.field}"; ) and this didn't work.

Previous solution in CCv5 was easy: $thisnewvariable = $row['model']['field'];

Any ideas anyone?

Thanks in advance for any assistance, Paddy
Max_admin Max_admin 01 Feb, 2024
Answer
you should use:
$this->get("repeatername.row.model.field");

that should work in PHP if {var:repeatername.row.model.field} works for you
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pa paddy285 01 Feb, 2024
1 Likes
Max,

What a legend, what a superstar!

Complete game changer for me! Worked like a dream!

Thanks for taking the time to get back to me and providing such an easy answer! Brilliant!

Cheers, Paddy
Max_admin Max_admin 01 Feb, 2024
You are welcome!🙂
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.