I have array of objects users. Entity User has two fields: firstName and lastName; In my controller I add all users to the some array which called employees.
$employees = array();
foreach($users as $user) {
$employees[] = $user->firstName;
}
How can i get on the view element of array by firstName.
I tried like this:
$employees['John']
but it doesn't work
Thanks in advance