An open API service indexing awesome lists of open source software.

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

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
[![LICENSE MIT](https://img.shields.io/badge/Mail%20me%20at-lodev09%40gmail.com-green.svg)](mailto:lodev09@gmail.com)

## Credits
© 2018 - Coded by Jovanni Lo / [@lodev09](http://twitter.com/lodev09)

## License
Released under the [![LICENSE MIT](https://img.shields.io/badge/license-MIT-red.svg)](http://opensource.org/licenses/MIT)
See [LICENSE](LICENSE) file.