Controller
$client = new Client();
$client->get('id');
foreach($client->all as $entry)
{
$clientID = $entry->id;
$entry->company->get('companyname');
$companyName = $entry->company->companyname;
$data['parent'][$clientID] = $companyName;
}
View
<?php echo form_dropdown('Parent', $parent )?>
Im trying to set the default value for the dropdown to something like “Not Applicable”
With an index of 0. This dropdown is for Parent clients (ie. The client of a client) but not all clients will have a parent client.