Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

[Added] nuOnProcessObjects() PHP

Information about updates, news, Code Library
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

[Added] nuOnProcessObjects() PHP

Unread post by admin »

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"

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;
        }

    }

}
Post Reply