if(!isset($_POST['tos']))
$this->errors[] = 'Please accept our Terms of Service.';`
What this is doing is saying if there is no 'tos' in $_POST, throw an error.
Really you should probably check this client side with javascript, before the form is sent to the server.
You could also...
<input type="checkbox" name="tos" value="accepted" checked>
And PHP:
if(isset($_POST['tos']) && $_POST['tos']==='accepted') echo 'All good';
else array_push($errors,'err code here'); //to add to $error array
Update
I'm not sure if you're using jQuery or not, but just for a more user friendly approach:
var tos = $('#tos');
var notice = $('.notice');
tos.on('click',function(){
if(tos.is(':checked')){
notice.text('Thank you.');
}
else{
notice.text('Please accept our ToS to continue.');
}
})
See a working example here. You could even halt the form all together if it's unchecked. BTW, if I remember correctly checkbox
inputs only send POST data if checked.