Array as value in Editor -> options
Array as value in Editor -> options

I have this:
Field::inst( 'valabilitate' ) ->options( 'tarife', array('tconcesiune', 'zconcesiune'), array('tconcesiune', 'zconcesiune')
The label is corectly taken but the value i cant take as an array.
<b>Warning</b>: Illegal offset type in.....
this works:
Field::inst( 'valabilitate' ) ->options( 'tarife','tconcesiune', array('tconcesiune', 'zconcesiune')
but this way i cant take the value also as an array.
I just need the value to be the same as the label.
Any suggestions or help is much apreciated!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Unfortunately only the label can be given as an array (and will be combined in order to get the string output). There is no built in option to give an array for the value (I presume you want it concatenated into a single string value?).
You would need to use a custom method if you want to use multiple database columns as the value for your select field.
Allan
thx Allan for the fast response
now it works :D
Code for others:
Thanks @allan and @Jhon Morano this put me on the right track to solve my problem.
P.S. It made me smile when I realized what language is the code in