PHP code example of lodev09 / bootstrap-php
1. Go to this page and download the library: Download lodev09/bootstrap-php 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/ */
lodev09 / bootstrap-php example snippets
use \Bootstrap\Components\Table;
// somewhere in your project.
// sample data from your db
$data = [
['name' => 'Jovanni Lo', 'email' => '[email protected]'],
['name' => 'foo', 'email' => '[email protected]']
];
$table = new Table($data);
$table->cell = [
'name' => [
'class' => 'text-primary',
'url' => '#docs',
// ... so much more
],
// can also be a closure
'username' => function($row, $index, $value) {
// print_r($row)
return '<strong>@'.$row['username'].'</strong>';
}
];
// print the html
$table->printHtml();