Forums

Front List PHP $row usage

t3living 01 Apr, 2016
I need to construct a conditional link in a CC list so I'm using the Front List PHP Function, but I'm lost on how to access the field data in the $row. I have 2 models rq, s and I need s.chronoform and s.sub_id
s.datesubmitted:if($cell == null){return "<i class='fa fa-ban' style='color:red;'></i>";} else {return "<a href='http://www.missionalive.org/ma/index.php?option=com_chronoforms5&chronoform=".$row['chronoform']."&id=".$row['sub_id']."&event=view' class='btn btn-xs btn-success'<i class='fa fa-check' style='color:green;'></i><small>".$cell."</small></a>";};


I
t3living 01 Apr, 2016
I just figured it out ...two things. first was that the data I needed was not in the $row, but then I access via $row[model_name][field_name]
GreyHead 02 Apr, 2016
Hi t3living,

So the data was in $row - but in a sub-array under the Model ID ?

Bob
t3living 02 Apr, 2016
I had to add the particular fields I needed to the first model list of fields to read from db, I don't list them in the displayed fields, but that puts them in the $row variable under the model ID
This topic is locked and no more replies can be posted.