Can I use placeholders in php scheduled tasks?

prophoto

Active Member
Can I use placeholders in php scheduled tasks? I've tried putting $domain = '{fab_domains___domain_name}'; in the PHP Setup field but its not being passed to the script I've chosen in the PHP Script dropdown.

Its not mentioned in the wiki, I'll gladly update with the answer.
 
No, because where we call your code, we're not iterating through the rows themselves. We just allow you to access $data (the array that holds the grouped row data).

In order to apply placeholders, we have to be processing an individual row in a list (or a form's data). In other words, how do we know which of the lists rows in $data you want us to do the substitution with?

You'll need to access that yourself, in your foreach() that handles $data. Pass $data (and optionally $listModel if you need it) in to your function ...

Code:
myFunc($data, $listModel);

... and in myFunc ...

Code:
function myFunc($data, $listModel) {
   // blah blah
   foreach ($data as $group) {
      foreach ($group as $row) {
         // append _raw if you need to (like if the non-raw has extra formatting, like details link, etc
         $domainName = $row->fab_domains___domain_name;
         // blah blah
      }
   }
}

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

Thank you.

Members online

Back
Top