[Added] nuOnProcessObjects() PHP
Posted: Mon May 09, 2022 2:00 pm
Add a function called nuOnProcessObjects() in the Before Edit (BE) PHP event to pre-process/manipulate object properties (e.g. label, visibility, position etc.) before the form is rendered.
Example: Set the current date for the date object "date_issued"
Example: Set the current date for the date object "date_issued"
Code: Select all
function nuOnProcessObjects() {
for ($i = 0; $i < count($f->objects); $i++) {
if ($f->objects[$i]->id == 'date_issued' && $f->objects[$i]->value == '') {
$f->objects[$i]->value = date('Y-m-d');
break;
}
}
}