lodev09 / bootstrap-php
A highly extendable PHP library that generate and prints html for bootstrap.
Installs: 8 274
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 4
Forks: 3
Open Issues: 1
Requires
- php: >=5.4
- lodev09/php-util: >=1.2
This package is auto-updated.
Last update: 2024-12-09 03:02:34 UTC
README
A highly extendable PHP library that generate and prints html for bootstrap.
Installation
$ composer require lodev09/bootstrap-php
Built-in Components
The library has built-in components that are already available for you to use. See creating custom components to learn more on how to create your own component.
- Table - Print tables from datasource
- Button - Print simple buttons
- Select - Print select from datasource
- Alert - Print alert
- Input - Print input (text, password, etc)
If you want me to add your own component, feel free to contribute and submit a PR!
Usage
use \Bootstrap\Components\Table; // somewhere in your project. // sample data from your db $data = [ ['name' => 'Jovanni Lo', 'email' => 'lodev09@gmail.com'], ['name' => 'foo', 'email' => 'bar@email.com'] ]; $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();
Feedback
All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at www.lodev09.com or
Credits
© 2018 - Coded by Jovanni Lo / @lodev09
License
Released under the See LICENSE file.