Input/checkboxes setting

Hello everyone,

I'm currently developing a plugin that enable the users to choose whether he wants to display the Google ads sense on his website or not. However I have a problem with the checkboxes in the plugin settings. After I check the box and save the settings, it doesn't show that I ticked the box, and I also don't know how to catch the checkbox value. Here is my code for settings:

<?php echo elgg_view("input/checkboxes",
array('internalname'=>'params[header728x90]',
'value'=>array($vars['entity']->header728x90),
'options'=>array("Enable Header 728x90 ads"=>'header728x90')));
?>

Please excuse my bad English, and also I'm new to plugin developing, my knowledge is quite limited.

Thanks in advance,

Tuan Dang

  • echo elgg_view('input/checkboxes', array(
                'options' => array(elgg_echo("Enable Header 728x90 ads") => '728x90',
                                    elgg_echo("Enable Header 300x250 ads") => '300x250',
                                    elgg_echo("Enable Header 600x80 ads") => '600x80',   
                'value' => unserialize($vars['entity']->ads_header),
                'name' => 'params[ads_header]',
                'align' => 'vertical',
            ));

  • @RvR It doesn't seem to work for me, could you explain a little bit about how to implement your code?

    Thanks in advance,

    Tuan Dang