Record::selected - jcobban/Genealogy GitHub Wiki

$record->selected

Up: class Record

This public attribute is a boolean which controls the value returned from requesting the value of the simulated field 'selected' which is typically used in expansions of <option> tags within a <select>. If this attribute is true then $record->get('selected') and $record['selected'] return 'selected="selected"' otherwise it returns an empty string. However note that $record->selected returns the last value assigned to $record->selected or false if no value has been assigned.

For example:

$sources                         = new RecordSet('Sources');
$sources[$idsr]->selected        = true;
$template['option$idsr']->update($sources);

where the template contains:

<select id='IDSR'>
    <option id='option$idsr' value='$idsr'>$srcname</option>
</select>

Expands to a <select> with one <option> for each record in the table 'Sources' with the <option> matching $idsr selected.

Next: $record->row

⚠️ **GitHub.com Fallback** ⚠️