$active = AphrontRequest::getBool('active', false); if($active){ // do something if active true }else{ // do something if active is false }
$agree = AphrontRequest::getBool('agree', false); if($agree){ // do something if agree is true }else{ // do something if agree is false }In both examples, the AphrontRequest package library is used to fetch the boolean value from the query parameter or post data.