I know I can reference a class’ property using a variable as follows:
$field_name = 'first_name';
$myobject->$field_name // references $myobject->first_name
Is there a way I can reference a class property using another class’ property? For example,
$myobject->{$model->field_name} // Does not work
This works for me:
It prints: