PHP code example of flsouto / htcheckb

1. Go to this page and download the library: Download flsouto/htcheckb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flsouto / htcheckb example snippets



use FlSouto\HtCheckb;
newsletter","Receive newsletter?");

echo $checkbox;

use FlSouto\HtCheckb;
eckb("newsletter");
$checkbox->readonly();

echo $checkbox;

use FlSouto\HtCheckb;

$checkbox = new HtCheckb('newsletter','Newsletter','true','false');
$checkbox->fallback('true');

echo $checkbox;


$checkbox = new HtCheckb('newsletter','Newsletter','true','false');
$checkbox->fallback('true')->context(['newsletter_submit'=>1]);

echo $checkbox;


// let's pretend this data was loaded from the database
$row = ['active'=>'N'];

$checkbox = new HtCheckb('active','Active','Y','N');
$checkbox->fallback('Y'); // check by default
$checkbox->context($row); // set the form's state

echo $checkbox;