In my .xml file I created the following grouped list:

<field name="mylistvalue" type="groupedlist" default="" label="Select an option" description="" multiple="true">
<group label="Color">
 <option value="red">red</option>
 <option value="blue">blue</option>
 <option value="green">green</option>
<group label="Size">
 <option value="small">small</option>
 <option value="medium">medium</option>
 <option value="large">large</option>

How can I output the selected values in my .php file?

For type="list" it works with:

<?php echo $params->get('mylistvalue');?>

For type="groupedlist" with the option multiple="true" I only get the output: Array and not the selected values.

1 Answer 1


How do you store these values? Seems that is an array and should be displayed as:

<?php foreach ($params->get('mylistvalue') as $value) : ?>
    <?php echo $value; ?>
<?php endforeach; ?>
  • Just after that I was looking for. You are right, it is an array. Many Thanks. Jan 8, 2015 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.