https://github.com/lodev09/bootstrap-php
A PHP library that prints html for bootstrap
https://github.com/lodev09/bootstrap-php
Last synced: 6 months ago
JSON representation
A PHP library that prints html for bootstrap
- Host: GitHub
- URL: https://github.com/lodev09/bootstrap-php
- Owner: lodev09
- License: mit
- Created: 2018-09-22T07:37:18.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-21T22:40:50.000Z (over 4 years ago)
- Last Synced: 2025-09-05T03:53:26.352Z (11 months ago)
- Language: PHP
- Size: 86.9 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Bootstrap PHP
============================
A highly extendable PHP library that generate and prints html for [bootstrap](http://getbootstrap.com/).
## Installation
```term
$ 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](https://github.com/lodev09/bootstrap-php/tree/master/docs/custom.md) to learn more on how to create your own component.
- [Table](docs/table.md) - Print tables from datasource
- [Button](docs/button.md) - Print simple buttons
- [Select](docs/select.md) - Print select from datasource
- [Alert](docs/alert.md) - Print alert
- [Input](docs/input.md) - Print input (text, password, etc)
_If you want me to add your own component, feel free to contribute and submit a PR!_
## Usage
```php
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 '@'.$row['username'].'';
}
];
// print the html
$table->printHtml();
```
## Feedback
All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at [www.lodev09.com](http://www.lodev09.com "www.lodev09.com") or
[](mailto:lodev09@gmail.com)
## Credits
© 2018 - Coded by Jovanni Lo / [@lodev09](http://twitter.com/lodev09)
## License
Released under the [](http://opensource.org/licenses/MIT)
See [LICENSE](LICENSE) file.