4

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>
<group label="Size">
 <option value="small">small</option>
 <option value="medium">medium</option>
 <option value="large">large</option>
</group>
</field>

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.

3

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; ?>
1
  • Just after that I was looking for. You are right, it is an array. Many Thanks. Jan 8 '15 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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