Hi, my apologies if this makes no sense, I find these things difficult to explain!
I'm creating a block with an instance config page, on this page I'd like to give the user a list of teachers to chose from, where they can select multiple values from this list.
However I have tried to store this array of values in $this->config->teacherslist but have found I cannot store an array here.
How would I be best storing the multiple values in the block's instance config?
Many thanks,
Dale.
Why can't you store an array there? I would expect that to work. $this->config->teacherslist = array('fred', 'jane');
To be honest I dont know exactly why I cant store an array in there, I thought it was something about the variable being stored in the database meaning it cant be stored as an array. Or is that complete nonsense?
It definately doesnt work, I know that. After the instance config page is saved, I cant retreive all the values, only the last value. As in, the last value seems to be stored as a string.
Ive come up with a way around it however, using javascript to concatenate all the values into a comma delimited string before the form is posted. Then use explode() to put them back into an array when I need them.
It definately doesnt work, I know that. After the instance config page is saved, I cant retreive all the values, only the last value. As in, the last value seems to be stored as a string.
Ive come up with a way around it however, using javascript to concatenate all the values into a comma delimited string before the form is posted. Then use explode() to put them back into an array when I need them.