Closed SebastianoOlivo closed 6 years ago
Color fields will return a craft\fields\data\ColorData object. You can either cast it to a string or call its getHex()
function:
'option1' => (string)$entry->colorField,
'option2' => $entry->colorField->getHex(),
Thanks for this clarification Brandon. It work like a charm !
Hello,
When I try to get the value of a color field I get back an empty Object :
entry => colorFieldName,
Since this case is note documented, I have no idea if it's a bug or just the wrong way to get back the hexadecimal info of a color from a color field.
Could you please check this ?
Kr,
Sebastiano