Skip to content

Instantly share code, notes, and snippets.

@atsea
Created August 6, 2014 15:15
Show Gist options
  • Save atsea/dcb4fdae423dedde1606 to your computer and use it in GitHub Desktop.
Save atsea/dcb4fdae423dedde1606 to your computer and use it in GitHub Desktop.
class checkbox_platform{
public static function getPlatform(){
$template_swplatform = array(
'Windows' => 'Windows',
'Mac' => 'Mac',
'Linux' => 'Linux',
'Unix' => 'Unix'
);
return $template_swplatform;
}
}
/* paste below in content section */
<?php
foreach ( checkbox_platform::getPlatform() as $key=>$value){
?>
<input type="checkbox" name="sw_platform[]" value="<?php echo $key; ?>"
<?php
checked($sw_platform, 1);
?>
><?php echo $value; ?><br>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment